gophercloud: Index | Files | Directories

package volumeattach

import ""

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


Package Files

doc.go requests.go results.go urls.go

func ExtractVolumeAttachments Uses

func ExtractVolumeAttachments(page pagination.Page) ([]VolumeAttachment, error)

ExtractVolumeAttachments interprets a page of results as a slice of VolumeAttachments.

func List Uses

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 Uses

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 Uses

func (opts CreateOpts) ToVolumeAttachmentCreateMap() (map[string]interface{}, error)

ToVolumeAttachmentCreateMap constructs a request body from CreateOpts.

type CreateOptsBuilder Uses

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 Uses

type CreateResult struct {

CreateResult is the response from a Create operation. Call its Extract method to interpret it as a VolumeAttachment.

func Create Uses

func Create(client *gophercloud.ServiceClient, serverId string, opts CreateOptsBuilder) CreateResult

Create requests the creation of a new volume attachment on the server

type DeleteResult Uses

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 Uses

func Delete(client *gophercloud.ServiceClient, serverId, aId string) DeleteResult

Delete requests the deletion of a previous stored VolumeAttachment from the server.

type GetResult Uses

type GetResult struct {

GetResult is the response from a Get operation. Call its Extract method to interpret it as a VolumeAttachment.

func Get Uses

func Get(client *gophercloud.ServiceClient, serverId, aId string) GetResult

Get returns public data about a previously created VolumeAttachment.

type VolumeAttachment Uses

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.

type VolumeAttachmentResult Uses

type VolumeAttachmentResult struct {

func (VolumeAttachmentResult) Extract Uses

func (r VolumeAttachmentResult) Extract() (*VolumeAttachment, error)

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

type VolumeAttachmentsPage Uses

type VolumeAttachmentsPage struct {

VolumeAttachmentsPage stores a single, only page of VolumeAttachments results from a List call.

func (VolumeAttachmentsPage) IsEmpty Uses

func (page VolumeAttachmentsPage) IsEmpty() (bool, error)

IsEmpty determines whether or not a VolumeAttachmentsPage is empty.


testingThis is package created is to hold fixtures (which imports testing), so that importing volumeattach package does not inadvertently import testing into production code More information here:

Package volumeattach imports 4 packages (graph) and is imported by 236 packages. Updated 2016-07-23. Refresh now. Tools for package owners.