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

     1  package virtual_interface
     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 Virtual Interface.
     9  type UpdateOpts struct {
    10  	// Provides supplementary information about the virtual interface.
    11  	Description string `json:"description,omitempty"`
    12  	// Specifies the virtual interface name.
    13  	Name string `json:"name,omitempty"`
    14  	// Specifies the virtual interface bandwidth.
    15  	Bandwidth int `json:"bandwidth,omitempty"`
    16  	// Specifies the ID of the remote endpoint group that records the CIDR blocks used by the on-premises network.
    17  	RemoteEndpointGroupId string `json:"remote_ep_group_id,omitempty"`
    18  }
    19  
    20  // Update is an operation which modifies the attributes of the specified
    21  func Update(c *golangsdk.ServiceClient, id string, opts UpdateOpts) (err error) {
    22  	b, err := build.RequestBody(opts, "virtual_interface")
    23  	if err != nil {
    24  		return
    25  	}
    26  
    27  	_, err = c.Put(c.ServiceURL("dcaas", "virtual-interfaces", id), b, nil, &golangsdk.RequestOpts{
    28  		OkCodes: []int{200, 202},
    29  	})
    30  
    31  	return
    32  }