github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/vpc/v3/vpcs/RemoveSecondaryCIDR.go (about)

     1  package vpcs
     2  
     3  import (
     4  	"github.com/opentelekomcloud/gophertelekomcloud"
     5  	"github.com/opentelekomcloud/gophertelekomcloud/internal/build"
     6  	"github.com/opentelekomcloud/gophertelekomcloud/internal/extract"
     7  )
     8  
     9  // RemoveSecondaryCidr is used to add a secondary CIDR block to a VPC.
    10  func RemoveSecondaryCidr(client *golangsdk.ServiceClient, id string, opts CidrOpts) (*Vpc, error) {
    11  	b, err := build.RequestBody(opts, "")
    12  	if err != nil {
    13  		return nil, err
    14  	}
    15  
    16  	// PUT /v3/{project_id}/vpc/vpcs/{vpc_id}/remove-extend-cidr
    17  	raw, err := client.Put(client.ServiceURL("vpcs", id, "remove-extend-cidr"), b, nil, &golangsdk.RequestOpts{
    18  		OkCodes: []int{200},
    19  	})
    20  	if err != nil {
    21  		return nil, err
    22  	}
    23  
    24  	var res Vpc
    25  	err = extract.IntoStructPtr(raw.Body, &res, "vpc")
    26  	return &res, err
    27  }