storage

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Device   string `json:"device,omitempty"`
	Resource string `json:"resource,omitempty"`
}

Attachment represents the attachment details for a block volume.

type BlockVolume

type BlockVolume struct {
	AttachedTo       []Attachment           `json:"attachedTo,omitempty"`
	CrossAttach      types.NumericalBoolean `json:"cross_attach,omitempty"`
	Domain           string                 `json:"domain,omitempty"`
	Label            string                 `json:"label,omitempty"`
	Size             types.FlexInt          `json:"size,omitempty"`
	Status           string                 `json:"status,omitempty"`
	UniqID           string                 `json:"uniq_id,omitempty"`
	ZoneAvailability []types.FlexInt        `json:"zoneAvailability,omitempty"`
}

BlockVolume is the resource representing a block volume.

type BlockVolumeBackend

type BlockVolumeBackend interface {
	Create(*BlockVolumeParams) (*BlockVolume, error)
	Details(string) (*BlockVolume, error)
	List(*BlockVolumeParams) (*BlockVolumeList, error)
	Update(*BlockVolumeParams) (*BlockVolume, error)
	Delete(string) (*BlockVolumeDeletion, error)
	Resize(*BlockVolumeParams) (*BlockVolumeResize, error)
}

BlockVolumeBackend describes the interface for interactions with the API.

type BlockVolumeClient

type BlockVolumeClient struct {
	Backend liquidweb.Backend
}

BlockVolumeClient is the backend implementation for interacting with block volumes.

func (*BlockVolumeClient) Create

func (c *BlockVolumeClient) Create(params *BlockVolumeParams) (*BlockVolume, error)

Create creates a new block volume.

func (*BlockVolumeClient) Delete

Delete will delete a block volume.

func (*BlockVolumeClient) Details

func (c *BlockVolumeClient) Details(id string) (*BlockVolume, error)

Details returns details about a block volume.

func (*BlockVolumeClient) List

List returns a list of block volumes.

func (*BlockVolumeClient) Resize

Resize will resize a block volume.

func (*BlockVolumeClient) Update

func (c *BlockVolumeClient) Update(params *BlockVolumeParams) (*BlockVolume, error)

Update will update a block volume.

type BlockVolumeDeletion

type BlockVolumeDeletion struct {
	Deleted string `json:"deleted"`
}

BlockVolumeDeletion represents the API result when deleting a block volume.

type BlockVolumeList

type BlockVolumeList struct {
	liquidweb.ListMeta
	Items []BlockVolume `json:"items,omitempty"`
}

BlockVolumeList is an envelope for the API result containing either a list of block volumes or an error.

type BlockVolumeParams

type BlockVolumeParams struct {
	Attach      string `json:"attach,omitempty"`
	CrossAttach bool   `json:"cross_attach,omitempty"`
	DetachFrom  string `json:"detach_from,omitempty"`
	Domain      string `json:"domain,omitempty"`
	NewSize     int    `json:"new_size,omitempty"`
	Region      int    `json:"region,omitempty"`
	Size        int    `json:"size,omitempty"`
	To          string `json:"to,omitempty"`
	UniqID      string `json:"uniq_id,omitempty"`
	Zone        int    `json:"zone,omitempty"`
	liquidweb.PageParams
}

BlockVolumeParams is the set of parameters used when creating or updating a block volume

type BlockVolumeResize

type BlockVolumeResize struct {
	NewSize types.FlexInt `json:"new_size,omitempty"`
	OldSize types.FlexInt `json:"old_size,omitempty"`
	UniqID  string        `json:"uniq_id,omitempty"`
}

BlockVolumeResize represents the API result when resizing a block volume.

Jump to

Keyboard shortcuts

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