externalstorage

package
v1.20.4-rc1 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 12 Imported by: 17

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetInstance

func SetInstance(i Ops)

SetInstance replaces the instance with the provided one. Should be used only for testing purposes.

Types

type Client

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

Client is a wrapper for the external-storage client.

func New

func New(client rest.Interface) *Client

New builds a new client for the given config.

func NewForConfig

func NewForConfig(c *rest.Config) (*Client, error)

NewForConfig builds a new client for the given config.

func (*Client) CreateSnapshot

func (c *Client) CreateSnapshot(snap *snapv1.VolumeSnapshot) (*snapv1.VolumeSnapshot, error)

CreateSnapshot creates the given snapshot

func (*Client) CreateSnapshotData

func (c *Client) CreateSnapshotData(snapData *snapv1.VolumeSnapshotData) (*snapv1.VolumeSnapshotData, error)

CreateSnapshotData creates the given volume snapshot data object

func (*Client) DeleteSnapshot

func (c *Client) DeleteSnapshot(name string, namespace string) error

DeleteSnapshot deletes the given snapshot

func (*Client) DeleteSnapshotData

func (c *Client) DeleteSnapshotData(name string) error

DeleteSnapshotData deletes the given snapshot

func (*Client) GetSnapshot

func (c *Client) GetSnapshot(name string, namespace string) (*snapv1.VolumeSnapshot, error)

GetSnapshot returns the snapshot for given name and namespace

func (*Client) GetSnapshotData

func (c *Client) GetSnapshotData(name string) (*snapv1.VolumeSnapshotData, error)

GetSnapshotData returns the snapshot for given name

func (*Client) GetSnapshotStatus

func (c *Client) GetSnapshotStatus(name string, namespace string) (*snapv1.VolumeSnapshotStatus, error)

GetSnapshotStatus returns the status of the given snapshot

func (*Client) GetVolumeForSnapshot

func (c *Client) GetVolumeForSnapshot(name string, namespace string) (string, error)

GetVolumeForSnapshot returns the volumeID for the given snapshot

func (*Client) ListSnapshots

func (c *Client) ListSnapshots(namespace string) (*snapv1.VolumeSnapshotList, error)

ListSnapshots lists all snapshots in the given namespace

func (*Client) SetConfig

func (c *Client) SetConfig(cfg *rest.Config)

SetConfig sets the config and resets the client

func (*Client) UpdateSnapshot

func (c *Client) UpdateSnapshot(snap *snapv1.VolumeSnapshot) (*snapv1.VolumeSnapshot, error)

UpdateSnapshot updates the given snapshot

func (*Client) ValidateSnapshot

func (c *Client) ValidateSnapshot(name string, namespace string, retry bool, timeout, retryInterval time.Duration) error

ValidateSnapshot validates the given snapshot.

func (*Client) ValidateSnapshotData

func (c *Client) ValidateSnapshotData(name string, retry bool, timeout, retryInterval time.Duration) error

ValidateSnapshotData validates the given snapshot data object

type Ops

type Ops interface {
	SnapshotOps

	// SetConfig sets the config and resets the client
	SetConfig(config *rest.Config)
}

Ops is an interface to perform operations on external storage resources.

func Instance

func Instance() Ops

Instance returns a singleton instance of the client.

func NewInstanceFromConfigFile

func NewInstanceFromConfigFile(config string) (Ops, error)

NewInstanceFromConfigFile returns new instance of client by using given config file

type SnapshotOps

type SnapshotOps interface {
	// GetSnapshot returns the snapshot for given name and namespace
	GetSnapshot(name string, namespace string) (*snapv1.VolumeSnapshot, error)
	// ListSnapshots lists all snapshots in the given namespace
	ListSnapshots(namespace string) (*snapv1.VolumeSnapshotList, error)
	// CreateSnapshot creates the given snapshot
	CreateSnapshot(*snapv1.VolumeSnapshot) (*snapv1.VolumeSnapshot, error)
	// UpdateSnapshot updates the given snapshot
	UpdateSnapshot(*snapv1.VolumeSnapshot) (*snapv1.VolumeSnapshot, error)
	// DeleteSnapshot deletes the given snapshot
	DeleteSnapshot(name string, namespace string) error
	// ValidateSnapshot validates the given snapshot.
	ValidateSnapshot(name string, namespace string, retry bool, timeout, retryInterval time.Duration) error
	// GetVolumeForSnapshot returns the volumeID for the given snapshot
	GetVolumeForSnapshot(name string, namespace string) (string, error)
	// GetSnapshotStatus returns the status of the given snapshot
	GetSnapshotStatus(name string, namespace string) (*snapv1.VolumeSnapshotStatus, error)
	// GetSnapshotData returns the snapshot for given name
	GetSnapshotData(name string) (*snapv1.VolumeSnapshotData, error)
	// CreateSnapshotData creates the given volume snapshot data object
	CreateSnapshotData(*snapv1.VolumeSnapshotData) (*snapv1.VolumeSnapshotData, error)
	// DeleteSnapshotData deletes the given snapshot
	DeleteSnapshotData(name string) error
	// ValidateSnapshotData validates the given snapshot data object
	ValidateSnapshotData(name string, retry bool, timeout, retryInterval time.Duration) error
}

SnapshotOps is an interface to perform k8s VolumeSnapshot operations

Jump to

Keyboard shortcuts

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