volumes

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(client *golangsdk.ServiceClient, id string) (err error)

Types

type CreateOpts

type CreateOpts struct {
	Size             int               `json:"size" required:"true"`
	AvailabilityZone string            `json:"availability_zone,omitempty"`
	Description      string            `json:"display_description,omitempty"`
	Metadata         map[string]string `json:"metadata,omitempty"`
	Name             string            `json:"display_name,omitempty"`
	SnapshotID       string            `json:"snapshot_id,omitempty"`
	SourceVolID      string            `json:"source_volid,omitempty"`
	ImageID          string            `json:"imageRef,omitempty"`
	VolumeType       string            `json:"volume_type,omitempty"`
}

type ListOpts

type ListOpts struct {
	// admin-only option. Set it to true to see all tenant volumes.
	AllTenants bool `q:"all_tenants"`
	// List only volumes that contain Metadata.
	Metadata map[string]string `q:"metadata"`
	// List only volumes that have Name as the display name.
	Name string `q:"display_name"`
	// List only volumes that have a status of Status.
	Status string `q:"status"`
}

type UpdateOpts

type UpdateOpts struct {
	Name        string            `json:"display_name,omitempty"`
	Description string            `json:"display_description,omitempty"`
	Metadata    map[string]string `json:"metadata,omitempty"`
}

type Volume

type Volume struct {
	// Current status of the volume.
	Status string `json:"status"`
	// Human-readable display name for the volume.
	Name string `json:"display_name"`
	// Instances onto which the volume is attached.
	Attachments []map[string]interface{} `json:"attachments"`
	// This parameter is no longer used.
	AvailabilityZone string `json:"availability_zone"`
	// Indicates whether this is a bootable volume.
	Bootable string `json:"bootable"`
	// The date when this volume was created.
	CreatedAt time.Time `json:"-"`
	// Human-readable description for the volume.
	Description string `json:"display_description"`
	// The type of volume to create, either SATA or SSD.
	VolumeType string `json:"volume_type"`
	// The ID of the snapshot from which the volume was created
	SnapshotID string `json:"snapshot_id"`
	// The ID of another block storage volume from which the current volume was created
	SourceVolID string `json:"source_volid"`
	// Arbitrary key-value pairs defined by the user.
	Metadata map[string]string `json:"metadata"`
	// Unique identifier for the volume.
	ID string `json:"id"`
	// Size of the volume in GB.
	Size int `json:"size"`
}

func Create

func Create(client *golangsdk.ServiceClient, opts CreateOpts) (*Volume, error)

func Get

func Get(client *golangsdk.ServiceClient, id string) (*Volume, error)

func List

func List(client *golangsdk.ServiceClient, opts ListOpts) ([]Volume, error)

func Update

func Update(client *golangsdk.ServiceClient, id string, opts UpdateOpts) (*Volume, error)

func (*Volume) UnmarshalJSON

func (r *Volume) UnmarshalJSON(b []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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