github.com/gophercloud/gophercloud@v1.11.0/openstack/loadbalancer/v2/flavorprofiles/doc.go (about) 1 /* 2 Package flavorprofiles provides information and interaction 3 with FlavorProfiles for the OpenStack Load-balancing service. 4 5 Example to List FlavorProfiles 6 7 listOpts := flavorprofiles.ListOpts{} 8 9 allPages, err := flavorprofiles.List(octaviaClient, listOpts).AllPages() 10 if err != nil { 11 panic(err) 12 } 13 14 allFlavorProfiles, err := flavorprofiles.ExtractFlavorProfiles(allPages) 15 if err != nil { 16 panic(err) 17 } 18 19 for _, flavorProfile := range allFlavorProfiles { 20 fmt.Printf("%+v\n", flavorProfile) 21 } 22 23 Example to Create a FlavorProfile 24 25 createOpts := flavorprofiles.CreateOpts{ 26 Name: "amphora-single", 27 ProviderName: "amphora", 28 FlavorData: "{\"loadbalancer_topology\": \"SINGLE\"}", 29 } 30 31 flavorProfile, err := flavorprofiles.Create(octaviaClient, createOpts).Extract() 32 if err != nil { 33 panic(err) 34 } 35 36 Example to Update a FlavorProfile 37 38 flavorProfileID := "dd6a26af-8085-4047-a62b-3080f4c76521" 39 40 updateOpts := flavorprofiles.UpdateOpts{ 41 Name: "amphora-single-updated", 42 } 43 44 flavorProfile, err := flavorprofiles.Update(octaviaClient, flavorProfileID, updateOpts).Extract() 45 if err != nil { 46 panic(err) 47 } 48 49 Example to Delete a FlavorProfile 50 51 flavorProfileID := "dd6a26af-8085-4047-a62b-3080f4c76521" 52 err := flavorprofiles.Delete(octaviaClient, flavorProfileID).ExtractErr() 53 if err != nil { 54 panic(err) 55 } 56 */ 57 package flavorprofiles