policytypes

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 25, 2023 License: Apache-2.0 Imports: 2 Imported by: 5

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

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

type SupportStatusType struct {
	Status string `json:"status"`
	Since  string `json:"since"`
}

SupportStatusType represents the support status information for a clustering policy type.

Directories

Path Synopsis
clustering_policytypes_v1
clustering_policytypes_v1

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL