github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/evs/extensions/volumeactions/extend_size.go (about)

     1  package volumeactions
     2  
     3  import "github.com/opentelekomcloud/gophertelekomcloud"
     4  
     5  type ExtendSizeOpts struct {
     6  	// NewSize is the new size of the volume, in GB.
     7  	NewSize int `json:"new_size" required:"true"`
     8  }
     9  
    10  func ExtendSize(client *golangsdk.ServiceClient, id string, opts ExtendSizeOpts) (err error) {
    11  	b, err := golangsdk.BuildRequestBody(opts, "os-extend")
    12  	if err != nil {
    13  		return
    14  	}
    15  
    16  	_, err = client.Post(client.ServiceURL("volumes", id, "action"), b, nil, nil)
    17  	return
    18  }