v0.3.1 Latest Latest

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

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



Package volumeattach provides the ability to attach and detach volumes to instances



This section is empty.


This section is empty.


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.


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 {

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 {

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 {

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 {

func (VolumeAttachmentResult) Extract

Extract is a method that attempts to interpret any VolumeAttachment resource response as a VolumeAttachment struct.

type VolumeAttachmentsPage

type VolumeAttachmentsPage struct {

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