github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/elb/v3/ipgroups/Update.go (about) 1 package ipgroups 2 3 import ( 4 "github.com/opentelekomcloud/gophertelekomcloud" 5 "github.com/opentelekomcloud/gophertelekomcloud/internal/build" 6 ) 7 8 // UpdateOpts represents options for updating a IpGroup. 9 type UpdateOpts struct { 10 // Specifies the IP address group name. 11 Name string `json:"name,omitempty"` 12 // Provides supplementary information about the IP address group. 13 Description string `json:"description,omitempty"` 14 // Lists the IP addresses in the IP address group. 15 IpList *[]IpGroupOption `json:"ip_list,omitempty"` 16 } 17 18 // Update is an operation which modifies the attributes of the specified 19 // IpGroup. 20 func Update(c *golangsdk.ServiceClient, id string, opts UpdateOpts) (err error) { 21 b, err := build.RequestBody(opts, "ipgroup") 22 if err != nil { 23 return 24 } 25 26 _, err = c.Put(c.ServiceURL("ipgroups", id), b, nil, &golangsdk.RequestOpts{ 27 OkCodes: []int{200, 202}, 28 }) 29 30 return 31 }