storage

package
v0.0.0-...-9b7dd3e Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	POLICY_NEVER     = "never"
	POLICY_ON_DEMAND = "on-demand"
)
View Source
const (
	KB = 1024
	MB = KB * 1024
	GB = MB * 1024
)

Variables

View Source
var MIGRATION_POLICYS = []string{POLICY_NEVER, POLICY_ON_DEMAND}

Functions

func InvalidMIgrationPoicy

func InvalidMIgrationPoicy(policy string) error

Types

type Attachment

type Attachment struct {
	Id           string `json:"id,omitempty"`
	ServerId     string `json:"server_id,omitempty"`
	AttachmentId string `json:"attachment_id,omitempty"`
	Device       string `json:"device,omitempty"`
	AttachmentAt string `json:"attached_at,omitempty"`
	HostName     string `json:"host_name,omitempty"`
	VolumeId     string `json:"volume_id,omitempty"`
}

type StorageClientV2

type StorageClientV2 struct {
	identity.IdentityClientV3

	BaseHeaders map[string]string
	// contains filtered or unexported fields
}

func GetStorageClientV2

func GetStorageClientV2(authClient identity.IdentityClientV3) (*StorageClientV2, error)

func (*StorageClientV2) GetCurrentVersion

func (client *StorageClientV2) GetCurrentVersion() (*identity.ApiVersion, error)

func (*StorageClientV2) Index

func (client *StorageClientV2) Index() (*common.Response, error)

func (StorageClientV2) UpdateVersion

func (client StorageClientV2) UpdateVersion()

func (StorageClientV2) VolumeCreate

func (client StorageClientV2) VolumeCreate(params map[string]interface{}) (*Volume, error)

func (StorageClientV2) VolumeDelete

func (client StorageClientV2) VolumeDelete(id string) error

func (StorageClientV2) VolumeExtend

func (client StorageClientV2) VolumeExtend(id string, size int) error

func (StorageClientV2) VolumeFound

func (client StorageClientV2) VolumeFound(idOrName string) (*Volume, error)

func (StorageClientV2) VolumeList

func (client StorageClientV2) VolumeList(query url.Values) ([]Volume, error)

func (StorageClientV2) VolumeListByName

func (client StorageClientV2) VolumeListByName(name string) ([]Volume, error)

func (StorageClientV2) VolumeListDetail

func (client StorageClientV2) VolumeListDetail(query url.Values) ([]Volume, error)

func (StorageClientV2) VolumeListDetailByName

func (client StorageClientV2) VolumeListDetailByName(name string) (Volumes, error)

func (StorageClientV2) VolumePrune

func (client StorageClientV2) VolumePrune(query url.Values, yes bool, waitDeleted bool)

func (StorageClientV2) VolumeRetype

func (client StorageClientV2) VolumeRetype(id string, newType string, migrationPolicy string) error

func (StorageClientV2) VolumeShow

func (client StorageClientV2) VolumeShow(id string) (*Volume, error)

func (StorageClientV2) VolumeTypeCreate

func (client StorageClientV2) VolumeTypeCreate(params map[string]interface{}) (*VolumeType, error)

func (StorageClientV2) VolumeTypeDefaultGet

func (client StorageClientV2) VolumeTypeDefaultGet() (*VolumeType, error)

func (StorageClientV2) VolumeTypeDelete

func (client StorageClientV2) VolumeTypeDelete(id string) error

func (StorageClientV2) VolumeTypeFound

func (client StorageClientV2) VolumeTypeFound(idOrName string) (*VolumeType, error)

func (StorageClientV2) VolumeTypeList

func (client StorageClientV2) VolumeTypeList(query url.Values) ([]VolumeType, error)

volume type api

func (StorageClientV2) VolumeTypeListByName

func (client StorageClientV2) VolumeTypeListByName(name string) ([]VolumeType, error)

func (StorageClientV2) VolumeTypeShow

func (client StorageClientV2) VolumeTypeShow(id string) (*VolumeType, error)

type Volume

type Volume struct {
	common.Resource
	Size       uint   `json:"size,omitempty"`
	VolumeType string `json:"volume_type,omitempty"`
	Bootable   string `json:"bootable"`

	Attachments         []Attachment      `json:"attachments"`
	Metadata            map[string]string `json:"metadata"`
	AvailabilityZone    string            `json:"availability_zone"`
	Host                string            `json:"os-vol-host-attr:host"`
	Multiattach         bool              `json:"multiattach"`
	SourceVolid         string            `json:"source_volid"`
	GroupId             string            `json:"group_id"`
	TaskStatus          string            `json:"task_status"`
	VolumeImageMetadata map[string]string `json:"volume_image_metadata"`
	TenantId            string            `json:"os-vol-tenant-attr:tenant_id,omitempty"`
}

func (Volume) GetAttachmentList

func (volume Volume) GetAttachmentList() []string

func (Volume) GetImageMetadataList

func (volume Volume) GetImageMetadataList() []string

func (Volume) GetMetadataList

func (volume Volume) GetMetadataList() []string

func (Volume) IsBootable

func (volume Volume) IsBootable() bool

type VolumeType

type VolumeType struct {
	common.Resource
	QosSpecsId                 string            `json:"qos_specs_id,omitempty"`
	IsPublic                   bool              `json:"is_public"`
	IsEncrypted                bool              `json:"is_encrypted"`
	OsVolumeTypeAccessIsPublic bool              `json:"os-volume-type-access:is_public"`
	ExtraSpecs                 map[string]string `json:"extra_specs,omitempty"`
}

func (VolumeType) GetExtraSpecsList

func (volumeType VolumeType) GetExtraSpecsList() []string

type Volumes

type Volumes []Volume

Jump to

Keyboard shortcuts

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