volumeattach

package
v0.0.0-...-f8ec1b3 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2017 License: Apache-2.0 Imports: 2 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 `json:"device,omitempty"`
	// VolumeID is the ID of the volume to attach to the instance
	VolumeID string `json:"volumeId" required:"true"`
}

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) (r 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, attachmentID string) (r 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, attachmentID string) (r 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 `json:"id"`

	// Device is what device the volume is attached as
	Device string `json:"device"`

	// VolumeID is the ID of the attached volume
	VolumeID string `json:"volumeId"`

	// ServerID is the ID of the instance that has the volume attached
	ServerID string `json:"serverId"`
}

VolumeAttachment controls the attachment of a volume to an instance.

func ExtractVolumeAttachments

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

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

type VolumeAttachmentPage

type VolumeAttachmentPage struct {
	pagination.SinglePageBase
}

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

func (VolumeAttachmentPage) IsEmpty

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

IsEmpty determines whether or not a VolumeAttachmentsPage is empty.

type VolumeAttachmentResult

type VolumeAttachmentResult struct {
	gophercloud.Result
}

VolumeAttachmentResult is the result from a volume attachment operation.

func (VolumeAttachmentResult) Extract

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

Directories

Path Synopsis
compute_extensions_volumeattach_v2
compute_extensions_volumeattach_v2

Jump to

Keyboard shortcuts

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