externalsnapshotter

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: 9 Imported by: 0

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

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 *v1beta1.VolumeSnapshot) (*v1beta1.VolumeSnapshot, error)

CreateSnapshot creates the given snapshot.

func (*Client) CreateSnapshotClass

func (c *Client) CreateSnapshotClass(snap *v1beta1.VolumeSnapshotClass) (*v1beta1.VolumeSnapshotClass, error)

CreateSnapshotClass creates the given snapshot class.

func (*Client) CreateSnapshotContent

func (c *Client) CreateSnapshotContent(snap *v1beta1.VolumeSnapshotContent) (*v1beta1.VolumeSnapshotContent, error)

CreateSnapshotContent creates the given snapshot content.

func (*Client) DeleteSnapshot

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

DeleteSnapshot deletes the given snapshot

func (*Client) DeleteSnapshotClass

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

DeleteSnapshotClass deletes the given snapshot

func (*Client) DeleteSnapshotContent

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

DeleteSnapshotContent deletes the given snapshot content

func (*Client) GetSnapshot

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

GetSnapshot returns the snapshot for given name and namespace

func (*Client) GetSnapshotClass

func (c *Client) GetSnapshotClass(name string) (*v1beta1.VolumeSnapshotClass, error)

GetSnapshotClass returns the snapshot class for given name

func (*Client) GetSnapshotContent

func (c *Client) GetSnapshotContent(name string) (*v1beta1.VolumeSnapshotContent, error)

GetSnapshotContent returns the snapshot content for given name

func (*Client) ListSnapshotClasses

func (c *Client) ListSnapshotClasses() (*v1beta1.VolumeSnapshotClassList, error)

ListSnapshotClasses lists all snapshot classes

func (*Client) ListSnapshotContents

func (c *Client) ListSnapshotContents() (*v1beta1.VolumeSnapshotContentList, error)

ListSnapshotContents lists all snapshot contents

func (*Client) ListSnapshots

func (c *Client) ListSnapshots(namespace string) (*v1beta1.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 *v1beta1.VolumeSnapshot) (*v1beta1.VolumeSnapshot, error)

UpdateSnapshot updates the given snapshot

func (*Client) UpdateSnapshotClass

func (c *Client) UpdateSnapshotClass(snap *v1beta1.VolumeSnapshotClass) (*v1beta1.VolumeSnapshotClass, error)

UpdateSnapshotClass updates the given snapshot class

func (*Client) UpdateSnapshotContent

func (c *Client) UpdateSnapshotContent(snap *v1beta1.VolumeSnapshotContent) (*v1beta1.VolumeSnapshotContent, error)

UpdateSnapshotContent updates the given snapshot content

type Ops

type Ops interface {
	SnapshotOps
	SnapshotContentOps
	SnapshotClassOps

	// 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 SnapshotClassOps

type SnapshotClassOps interface {
	// CreateSnapshotClass creates the given snapshot class
	CreateSnapshotClass(snap *v1beta1.VolumeSnapshotClass) (*v1beta1.VolumeSnapshotClass, error)
	// GetSnapshotClass returns the snapshot class for given name
	GetSnapshotClass(name string) (*v1beta1.VolumeSnapshotClass, error)
	// ListSnapshotClasses lists all snapshot classes
	ListSnapshotClasses() (*v1beta1.VolumeSnapshotClassList, error)
	// UpdateSnapshotClass updates the given snapshot class
	UpdateSnapshotClass(snap *v1beta1.VolumeSnapshotClass) (*v1beta1.VolumeSnapshotClass, error)
	// DeleteSnapshotClass deletes the given snapshot class
	DeleteSnapshotClass(name string) error
}

SnapshotClassOps is an interface to perform k8s VolumeSnapshotClass operations

type SnapshotContentOps

type SnapshotContentOps interface {
	// CreateSnapshotContent creates the given snapshot content
	CreateSnapshotContent(snap *v1beta1.VolumeSnapshotContent) (*v1beta1.VolumeSnapshotContent, error)
	// GetSnapshotContent returns the snapshot content for given name
	GetSnapshotContent(name string) (*v1beta1.VolumeSnapshotContent, error)
	// ListSnapshotContents lists all snapshot contents
	ListSnapshotContents() (*v1beta1.VolumeSnapshotContentList, error)
	// UpdateSnapshotContent updates the given snapshot content
	UpdateSnapshotContent(snap *v1beta1.VolumeSnapshotContent) (*v1beta1.VolumeSnapshotContent, error)
	// DeleteSnapshotContent deletes the given snapshot content
	DeleteSnapshotContent(name string) error
}

SnapshotContentOps is an interface to perform k8s VolumeSnapshotContent operations

type SnapshotOps

type SnapshotOps interface {
	// CreateSnapshot creates the given snapshot
	CreateSnapshot(snap *v1beta1.VolumeSnapshot) (*v1beta1.VolumeSnapshot, error)
	// GetSnapshot returns the snapshot for given name and namespace
	GetSnapshot(name string, namespace string) (*v1beta1.VolumeSnapshot, error)
	// ListSnapshots lists all snapshots in the given namespace
	ListSnapshots(namespace string) (*v1beta1.VolumeSnapshotList, error)
	// UpdateSnapshot updates the given snapshot
	UpdateSnapshot(snap *v1beta1.VolumeSnapshot) (*v1beta1.VolumeSnapshot, error)
	// DeleteSnapshot deletes the given snapshot
	DeleteSnapshot(name string, namespace string) 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