Documentation ¶
Index ¶
- func Attach(c *gcorecloud.ServiceClient, volumeID string, ...) (r tasks.Result)
- func Detach(c *gcorecloud.ServiceClient, volumeID string, ...) (r tasks.Result)
- func ExtractVolumeIDFromTask(task *tasks.Task) (string, error)
- type InstanceOperationOpts
- type InstanceOperationOptsBuilder
- type VolumeTaskResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Attach ¶
func Attach(c *gcorecloud.ServiceClient, volumeID string, opts InstanceOperationOptsBuilder) (r tasks.Result)
Attach accepts a InstanceOperationOpts struct and attach volume to an instance.
func Detach ¶
func Detach(c *gcorecloud.ServiceClient, volumeID string, opts InstanceOperationOptsBuilder) (r tasks.Result)
Detach accepts a InstanceOperationOpts struct and detach volume to an instance.
Types ¶
type InstanceOperationOpts ¶
type InstanceOperationOpts struct {
InstanceID string `json:"instance_id" required:"true" validate:"required,uuid4"`
}
InstanceOperationOpts allows prepare data for Attach and Detach requests
func (InstanceOperationOpts) ToVolumeInstanceOperationMap ¶
func (opts InstanceOperationOpts) ToVolumeInstanceOperationMap() (map[string]interface{}, error)
ToVolumeInstanceOperationMap builds a request body.
type InstanceOperationOptsBuilder ¶
type InstanceOperationOptsBuilder interface {
ToVolumeInstanceOperationMap() (map[string]interface{}, error)
}
InstanceOperationOptsBuilder prepare data to proceed with Attach and Detach requests
type VolumeTaskResult ¶
type VolumeTaskResult struct {
Volumes []string `json:"volumes"`
}
Click to show internal directories.
Click to hide internal directories.