volumetypes

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2014 License: Apache-2.0 Imports: 9 Imported by: 165

Documentation

Overview

Package volumetypes provides information and interaction with volume types in the OpenStack Block Storage service. A volume type indicates the type of a block storage volume, such as SATA, SCSCI, SSD, etc. These can be customized or defined by the OpenStack admin.

You can also define extra_specs associated with your volume types. For instance, you could have a VolumeType=SATA, with extra_specs (RPM=10000, RAID-Level=5) . Extra_specs are defined and customized by the admin.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

List returns all volume types.

func MockGetResponse

func MockGetResponse(t *testing.T)

func MockListResponse

func MockListResponse(t *testing.T)

Types

type CreateOpts

type CreateOpts struct {
	// OPTIONAL. See VolumeType.
	ExtraSpecs map[string]interface{}
	// OPTIONAL. See VolumeType.
	Name string
}

CreateOpts are options for creating a volume type.

func (CreateOpts) ToVolumeTypeCreateMap

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

ToVolumeTypeCreateMap casts a CreateOpts struct to a map.

type CreateOptsBuilder

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

CreateOptsBuilder allows extensions to add additional parameters to the Create request.

type CreateResult

type CreateResult struct {
	// contains filtered or unexported fields
}

CreateResult contains the response body and error from a Create request.

func Create

Create will create a new volume. To extract the created volume type object, call the Extract method on the CreateResult.

func (CreateResult) Extract

func (r CreateResult) Extract() (*VolumeType, error)

Extract will get the Volume Type object out of the commonResult object.

type DeleteResult

type DeleteResult struct {
	gophercloud.ErrResult
}

DeleteResult contains the response error from a Delete request.

func Delete

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

Delete will delete the volume type with the provided ID.

type GetResult

type GetResult struct {
	// contains filtered or unexported fields
}

GetResult contains the response body and error from a Get request.

func Get

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

Get will retrieve the volume type with the provided ID. To extract the volume type from the result, call the Extract method on the GetResult.

func (GetResult) Extract

func (r GetResult) Extract() (*VolumeType, error)

Extract will get the Volume Type object out of the commonResult object.

type ListResult

type ListResult struct {
	pagination.SinglePageBase
}

ListResult is a pagination.Pager that is returned from a call to the List function.

func (ListResult) IsEmpty

func (r ListResult) IsEmpty() (bool, error)

IsEmpty returns true if a ListResult contains no Volume Types.

type VolumeType

type VolumeType struct {
	ExtraSpecs map[string]interface{} `json:"extra_specs" mapstructure:"extra_specs"` // user-defined metadata
	ID         string                 `json:"id" mapstructure:"id"`                   // unique identifier
	Name       string                 `json:"name" mapstructure:"name"`               // display name
}

VolumeType contains all information associated with an OpenStack Volume Type.

func ExtractVolumeTypes

func ExtractVolumeTypes(page pagination.Page) ([]VolumeType, error)

ExtractVolumeTypes extracts and returns Volume Types.

Jump to

Keyboard shortcuts

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