github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/dcaas/v2/dc-endpoint-group/Update.go (about)

     1  package dc_endpoint_group
     2  
     3  import (
     4  	golangsdk "github.com/opentelekomcloud/gophertelekomcloud"
     5  	"github.com/opentelekomcloud/gophertelekomcloud/internal/build"
     6  )
     7  
     8  type UpdateOpts struct {
     9  	// Provides supplementary information about the Direct Connect endpoint group.
    10  	Description string `json:"description,omitempty"`
    11  	// Specifies the name of the Direct Connect endpoint group.
    12  	Name string `json:"name,omitempty"`
    13  }
    14  
    15  // Update is an operation which modifies the attributes of the specified Direct Connect endpoint group
    16  func Update(c *golangsdk.ServiceClient, id string, opts UpdateOpts) (err error) {
    17  	b, err := build.RequestBody(opts, "dc_endpoint_group")
    18  	if err != nil {
    19  		return
    20  	}
    21  
    22  	_, err = c.Put(c.ServiceURL("dcaas", "dc-endpoint-groups", id), b, nil, &golangsdk.RequestOpts{
    23  		OkCodes: []int{200, 202},
    24  	})
    25  
    26  	return
    27  }