volumetypes

package
v0.0.0-...-ae37572 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractVolumeTypesInto

func ExtractVolumeTypesInto(r pagination.Page, v interface{}) error

ExtractVolumesInto similar to ExtractInto but operates on a `list` of volume types

func List

List returns Volume types.

Types

type CreateOpts

type CreateOpts struct {
	// The name of the volume type
	Name string `json:"name" required:"true"`
	// The volume type description
	Description string `json:"description,omitempty"`
	// the ID of the existing volume snapshot
	IsPublic *bool `json:"os-volume-type-access:is_public,omitempty"`
	// Extra spec key-value pairs defined by the user.
	ExtraSpecs map[string]string `json:"extra_specs"`
}

CreateOpts contains options for creating a Volume Type. This object is passed to the volumetypes.Create function. For more information about these parameters, see the Volume Type object.

func (CreateOpts) ToVolumeTypeCreateMap

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

ToVolumeTypeCreateMap assembles a request body based on the contents of a CreateOpts.

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

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

Create will create a new Volume Type based on the values in CreateOpts. To extract the Volume Type object from the response, 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.

func (CreateResult) ExtractInto

func (r CreateResult) ExtractInto(v interface{}) error

ExtractInto converts our response data into a volume type struct

type DeleteResult

type DeleteResult struct {
	gophercloud.ErrResult
}

DeleteResult contains the response body and error from a Delete request.

func Delete

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

Delete will delete the existing 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) (r GetResult)

Get retrieves the Volume Type with the provided ID. To extract the Volume Type object from the response, 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.

func (GetResult) ExtractInto

func (r GetResult) ExtractInto(v interface{}) error

ExtractInto converts our response data into a volume type struct

type ListOpts

type ListOpts struct {
	// Comma-separated list of sort keys and optional sort directions in the
	// form of <key>[:<direction>].
	Sort string `q:"sort"`
	// Requests a page size of items.
	Limit int `q:"limit"`
	// Used in conjunction with limit to return a slice of items.
	Offset int `q:"offset"`
	// The ID of the last-seen item.
	Marker string `q:"marker"`
}

ListOpts holds options for listing Volume Types. It is passed to the volumetypes.List function.

func (ListOpts) ToVolumeTypeListQuery

func (opts ListOpts) ToVolumeTypeListQuery() (string, error)

ToVolumeTypeListQuery formats a ListOpts into a query string.

type ListOptsBuilder

type ListOptsBuilder interface {
	ToVolumeTypeListQuery() (string, error)
}

ListOptsBuilder allows extensions to add additional parameters to the List request.

type UpdateOpts

type UpdateOpts struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	IsPublic    *bool  `json:"is_public,omitempty"`
}

UpdateOpts contain options for updating an existing Volume Type. This object is passed to the volumetypes.Update function. For more information about the parameters, see the Volume Type object.

func (UpdateOpts) ToVolumeTypeUpdateMap

func (opts UpdateOpts) ToVolumeTypeUpdateMap() (map[string]interface{}, error)

ToVolumeUpdateMap assembles a request body based on the contents of an UpdateOpts.

type UpdateOptsBuilder

type UpdateOptsBuilder interface {
	ToVolumeTypeUpdateMap() (map[string]interface{}, error)
}

UpdateOptsBuilder allows extensions to add additional parameters to the Update request.

type UpdateResult

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

UpdateResult contains the response body and error from an Update request.

func Update

func Update(client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult)

Update will update the Volume Type with provided information. To extract the updated Volume Type from the response, call the Extract method on the UpdateResult.

func (UpdateResult) Extract

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

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

func (UpdateResult) ExtractInto

func (r UpdateResult) ExtractInto(v interface{}) error

ExtractInto converts our response data into a volume type struct

type VolumeType

type VolumeType struct {
	// Unique identifier for the volume type.
	ID string `json:"id"`
	// Human-readable display name for the volume type.
	Name string `json:"name"`
	// Human-readable description for the volume type.
	Description string `json:"description"`
	// Arbitrary key-value pairs defined by the user.
	ExtraSpecs map[string]string `json:"extra_specs"`
	// Whether the volume type is publicly visible.
	IsPublic bool `json:"is_public"`
	// Qos Spec ID
	QosSpecID string `json:"qos_specs_id"`
	// Volume Type access public attribute
	PublicAccess bool `json:"os-volume-type-access:is_public"`
}

Volume Type contains all the information associated with an OpenStack Volume Type.

func ExtractVolumeTypes

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

ExtractVolumeTypes extracts and returns Volumes. It is used while iterating over a volumetypes.List call.

type VolumeTypePage

type VolumeTypePage struct {
	pagination.LinkedPageBase
}

VolumeTypePage is a pagination.pager that is returned from a call to the List function.

func (VolumeTypePage) IsEmpty

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

IsEmpty returns true if a ListResult contains no Volume Types.

func (VolumeTypePage) NextPageURL

func (page VolumeTypePage) NextPageURL() (string, error)

Directories

Path Synopsis
volume_types
volume_types

Jump to

Keyboard shortcuts

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