volumeattach

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2015 License: Apache-2.0, Apache-2.0 Imports: 4 Imported by: 0

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

type CreateOptsBuilder interface {
	ToVolumeAttachmentCreateMap() (map[string]interface{}, error)
}

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL