github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/elb/v3/ipgroups/DeleteIpsFromList.go (about) 1 package ipgroups 2 3 import ( 4 "github.com/opentelekomcloud/gophertelekomcloud" 5 "github.com/opentelekomcloud/gophertelekomcloud/internal/build" 6 "github.com/opentelekomcloud/gophertelekomcloud/internal/extract" 7 ) 8 9 // DeleteIpFromList is used to create or update the ip list of specific ip group. 10 func DeleteIpFromList(c *golangsdk.ServiceClient, id string, opts BatchDeleteOpts) (*IpGroup, error) { 11 b, err := build.RequestBody(opts, "ipgroup") 12 if err != nil { 13 return nil, err 14 } 15 url := c.ServiceURL("ipgroups", id, "iplist", "batch-delete") 16 raw, err := c.Post(url, b, nil, &golangsdk.RequestOpts{ 17 OkCodes: []int{200}, 18 }) 19 if err != nil { 20 return nil, err 21 } 22 23 var res IpGroup 24 err = extract.IntoStructPtr(raw.Body, &res, "ipgroup") 25 return &res, err 26 } 27 28 // BatchDeleteOpts contains all the values needed to perform BatchDelete on the IP address group. 29 type BatchDeleteOpts struct { 30 // Specifies IP addresses that will be deleted from an IP address group in batches. 31 IpList []IpList `json:"ip_list,omitempty"` 32 } 33 type IpList struct { 34 // Specifies the IP addresses in the IP address group. 35 Ip string `json:"ip" required:"true"` 36 }