 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Overview ¶
Package policytypes lists all policy types and shows details for a policy type from the OpenStack Clustering Service.
Example to List Policy Types
allPages, err := policytypes.List(clusteringClient).AllPages()
if err != nil {
    panic(err)
}
allPolicyTypes, err := actions.ExtractPolicyTypes(allPages)
if err != nil {
    panic(err)
}
for _, policyType := range allPolicyTypes {
    fmt.Printf("%+v\n", policyType)
}
Example to Get a Policy Type
policyTypeName := "senlin.policy.affinity-1.0"
policyTypeDetail, err := policyTypes.Get(clusteringClient, policyTypeName).Extract()
if err != nil {
    panic(err)
}
fmt.Printf("%+v\n", policyTypeDetail)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(client *gophercloud.ServiceClient) pagination.Pager
List makes a request against the API to list policy types.
Types ¶
type GetResult ¶
type GetResult struct {
	// contains filtered or unexported fields
}
    GetResult is the result of a Get operation. Call its Extract method to interpret it as a PolicyTypeDetail.
func Get ¶
func Get(client *gophercloud.ServiceClient, policyTypeName string) (r GetResult)
Get makes a request against the API to get details for a policy type.
func (GetResult) Extract ¶
func (r GetResult) Extract() (*PolicyTypeDetail, error)
Extract interprets any policyTypeResult result as a PolicyTypeDetail.
type PolicyType ¶
type PolicyType struct {
	Name          string                         `json:"name"`
	Version       string                         `json:"version"`
	SupportStatus map[string][]SupportStatusType `json:"support_status"`
}
    PolicyType represents a clustering policy type in the Openstack cloud.
func ExtractPolicyTypes ¶
func ExtractPolicyTypes(r pagination.Page) ([]PolicyType, error)
ExtractPolicyTypes returns a slice of PolicyTypes from a List operation.
type PolicyTypeDetail ¶
type PolicyTypeDetail struct {
	Name          string                         `json:"name"`
	Schema        map[string]interface{}         `json:"schema"`
	SupportStatus map[string][]SupportStatusType `json:"support_status,omitempty"`
}
    PolicyTypeDetail represents the detailed policy type information for a clustering policy type.
type PolicyTypePage ¶
type PolicyTypePage struct {
	pagination.SinglePageBase
}
    PolicyTypePage contains a single page of all policy types from a List call.
func (PolicyTypePage) IsEmpty ¶
func (page PolicyTypePage) IsEmpty() (bool, error)
IsEmpty determines if a PolicyType contains any results.
type SupportStatusType ¶
SupportStatusType represents the support status information for a clustering policy type.