Documentation ¶
Overview ¶
Package volumeattach provides the ability to attach and detach volumes to instances
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func List ¶
func List(client *gophercloud.ServiceClient, serverId string) pagination.Pager
List returns a Pager that allows you to iterate over a collection of VolumeAttachments.
Types ¶
type CreateOpts ¶
type CreateOpts struct { // Device is the device that the volume will attach to the instance as. Omit for "auto" Device string // VolumeID is the ID of the volume to attach to the instance VolumeID string }
CreateOpts specifies volume attachment creation or import parameters.
func (CreateOpts) ToVolumeAttachmentCreateMap ¶
func (opts CreateOpts) ToVolumeAttachmentCreateMap() (map[string]interface{}, error)
ToVolumeAttachmentCreateMap constructs a request body from CreateOpts.
type CreateOptsBuilder ¶
CreateOptsBuilder describes struct types that can be accepted by the Create call. Notable, the CreateOpts struct in this package does.
type CreateResult ¶
type CreateResult struct {
VolumeAttachmentResult
}
CreateResult is the response from a Create operation. Call its Extract method to interpret it as a VolumeAttachment.
func Create ¶
func Create(client *gophercloud.ServiceClient, serverId string, opts CreateOptsBuilder) CreateResult
Create requests the creation of a new volume attachment on the server
type DeleteResult ¶
type DeleteResult struct {
gophercloud.ErrResult
}
DeleteResult is the response from a Delete operation. Call its Extract method to determine if the call succeeded or failed.
func Delete ¶
func Delete(client *gophercloud.ServiceClient, serverId, aId string) DeleteResult
Delete requests the deletion of a previous stored VolumeAttachment from the server.
type GetResult ¶
type GetResult struct {
VolumeAttachmentResult
}
GetResult is the response from a Get operation. Call its Extract method to interpret it as a VolumeAttachment.
func Get ¶
func Get(client *gophercloud.ServiceClient, serverId, aId string) GetResult
Get returns public data about a previously created VolumeAttachment.
type VolumeAttachment ¶
type VolumeAttachment struct { // ID is a unique id of the attachment ID string `mapstructure:"id"` // Device is what device the volume is attached as Device string `mapstructure:"device"` // VolumeID is the ID of the attached volume VolumeID string `mapstructure:"volumeId"` // ServerID is the ID of the instance that has the volume attached ServerID string `mapstructure:"serverId"` }
VolumeAttach controls the attachment of a volume to an instance.
func ExtractVolumeAttachments ¶
func ExtractVolumeAttachments(page pagination.Page) ([]VolumeAttachment, error)
ExtractVolumeAttachments interprets a page of results as a slice of VolumeAttachments.
type VolumeAttachmentResult ¶
type VolumeAttachmentResult struct {
gophercloud.Result
}
func (VolumeAttachmentResult) Extract ¶
func (r VolumeAttachmentResult) Extract() (*VolumeAttachment, error)
Extract is a method that attempts to interpret any VolumeAttachment resource response as a VolumeAttachment struct.
type VolumeAttachmentsPage ¶
type VolumeAttachmentsPage struct {
pagination.SinglePageBase
}
VolumeAttachmentsPage stores a single, only page of VolumeAttachments results from a List call.
func (VolumeAttachmentsPage) IsEmpty ¶
func (page VolumeAttachmentsPage) IsEmpty() (bool, error)
IsEmpty determines whether or not a VolumeAttachmentsPage is empty.