github.com/gophercloud/gophercloud@v1.11.0/openstack/clustering/v1/policytypes/doc.go (about) 1 /* 2 Package policytypes lists all policy types and shows details for a policy type 3 from the OpenStack Clustering Service. 4 5 Example to List Policy Types 6 7 allPages, err := policytypes.List(clusteringClient).AllPages() 8 if err != nil { 9 panic(err) 10 } 11 12 allPolicyTypes, err := actions.ExtractPolicyTypes(allPages) 13 if err != nil { 14 panic(err) 15 } 16 17 for _, policyType := range allPolicyTypes { 18 fmt.Printf("%+v\n", policyType) 19 } 20 21 Example to Get a Policy Type 22 23 policyTypeName := "senlin.policy.affinity-1.0" 24 policyTypeDetail, err := policyTypes.Get(clusteringClient, policyTypeName).Extract() 25 if err != nil { 26 panic(err) 27 } 28 29 fmt.Printf("%+v\n", policyTypeDetail) 30 */ 31 package policytypes