volume

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

README

Volume

pkg/handler/volume implements the public v2 Volume lifecycle API.

Volume creation validates the selected Network and VolumeClass, derives Region, Identity, organization, and project scope from that Network, and persists a controller-finalized Volume CRD owned by the Network with deletion blocking. Requested size is stored as a binary quantity while the API remains whole-GiB. Before persisting the CRD, creation allocates that binary-byte capacity against the Identity volumes quota. The allocation ID is stored on the Volume; a failed CRD write compensates by deleting the allocation.

List and get expose project-scoped metadata, immutable Network/class/size, the standard lifecycle and health projection, and observed size when it is present in CRD status. Attachment-derived fields are not projected by this package.

Updates replace mutable metadata and tags with optimistic locking while preserving Network, VolumeClass, size, claims, controller state, and any future allocation annotation. Delete is idempotent once started and rejects a Volume with an active attachment claim or resource reference until it is manually detached.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	common.ClientArgs
}

Client implements the v2 Volume lifecycle API.

func New

func New(args common.ClientArgs) *Client

New creates a Volume client.

func (*Client) CreateV2

func (c *Client) CreateV2(ctx context.Context, request *openapi.VolumeV2Create) (*openapi.VolumeV2Read, error)

CreateV2 creates a v2 Volume from Network-derived scope.

func (*Client) DeleteV2

func (c *Client) DeleteV2(ctx context.Context, volumeID regionids.VolumeID) error

DeleteV2 deletes an unattached v2 Volume.

func (*Client) GetV2

func (c *Client) GetV2(ctx context.Context, volumeID regionids.VolumeID) (*openapi.VolumeV2Read, error)

GetV2 gets a v2 Volume.

func (*Client) GetV2Raw

func (c *Client) GetV2Raw(ctx context.Context, volumeID string) (*regionv1.Volume, error)

GetV2Raw retrieves and authorizes a v2 Volume.

func (*Client) ListV2

ListV2 lists visible v2 Volumes.

func (*Client) UpdateV2

func (c *Client) UpdateV2(ctx context.Context, volumeID regionids.VolumeID, request *openapi.VolumeV2Update) (*openapi.VolumeV2Read, error)

UpdateV2 updates only Volume metadata and tags.

Jump to

Keyboard shortcuts

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