github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/dcaas/v2/direct-connect/Update.go (about) 1 package direct_connect 2 3 import ( 4 golangsdk "github.com/opentelekomcloud/gophertelekomcloud" 5 "github.com/opentelekomcloud/gophertelekomcloud/internal/build" 6 ) 7 8 type UpdateOpts struct { 9 // description of the direct connect 10 Description string `json:"description,omitempty"` 11 // name of the direct connect 12 Name string `json:"name,omitempty"` 13 // bandwidth of the direct connect in Mbps 14 Bandwidth int `json:"bandwidth,omitempty"` 15 // provider_status specifies the status of the carrier's leased line. 16 // The value can be ACTIVE or DOWN. 17 ProviderStatus string `json:"provider_status,omitempty"` 18 } 19 20 // Update is an operation which modifies the attributes of the specified direct connect 21 func Update(c *golangsdk.ServiceClient, id string, opts UpdateOpts) (err error) { 22 b, err := build.RequestBody(opts, "direct_connect") 23 if err != nil { 24 return 25 } 26 27 _, err = c.Put(c.ServiceURL("dcaas", "direct-connects", id), b, nil, &golangsdk.RequestOpts{ 28 OkCodes: []int{200, 202}, 29 }) 30 31 return 32 }