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