github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/dcaas/v2/virtual-gateway/Update.go (about)

     1  package virtual_gateway
     2  
     3  import (
     4  	golangsdk "github.com/opentelekomcloud/gophertelekomcloud"
     5  	"github.com/opentelekomcloud/gophertelekomcloud/internal/build"
     6  )
     7  
     8  // UpdateOpts represents options for updating a VirtualGateway.
     9  type UpdateOpts struct {
    10  	// Provides supplementary information about the virtual gateway.
    11  	Description string `json:"description,omitempty"`
    12  	// Specifies the virtual gateway name.
    13  	Name string `json:"name,omitempty"`
    14  	// Specifies the ID of the local endpoint group that records CIDR blocks of the VPC subnets.
    15  	LocalEndpointGroupId string `json:"local_ep_group_id,omitempty"`
    16  }
    17  
    18  // Update is an operation which modifies the attributes of the specified
    19  // VirtualGateway.
    20  func Update(c *golangsdk.ServiceClient, id string, opts UpdateOpts) (err error) {
    21  	b, err := build.RequestBody(opts, "virtual_gateway")
    22  	if err != nil {
    23  		return
    24  	}
    25  
    26  	_, err = c.Put(c.ServiceURL("dcaas", "virtual-gateways", id), b, nil, &golangsdk.RequestOpts{
    27  		OkCodes: []int{200, 202},
    28  	})
    29  
    30  	return
    31  }