cnsvolumeoperationrequest

package
v3.0.2-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// TaskInvocationStatusInProgress represents a task thats status is InProgress.
	TaskInvocationStatusInProgress = "InProgress"
	// TaskInvocationStatusError represents a task thats status is Error.
	TaskInvocationStatusError = "Error"
	// TaskInvocationStatusSuccess represents a task thats status is Success.
	TaskInvocationStatusSuccess = "Success"
)
View Source
const EnvCSINamespace = "CSI_NAMESPACE"

EnvCSINamespace represents the environment variable which stores the namespace in which the CSI driver is running.

Variables

This section is empty.

Functions

This section is empty.

Types

type OperationDetails

type OperationDetails struct {
	TaskInvocationTimestamp metav1.Time
	TaskID                  string
	VCenterServer           string
	OpID                    string
	TaskStatus              string
	Error                   string
}

OperationDetails stores information about a particular operation.

type VolumeOperationRequest

type VolumeOperationRequest interface {
	// GetRequestDetails returns the details of the operation on the volume
	// that is persisted by the VolumeOperationRequest interface.
	// Returns an error if any error is encountered while attempting to
	// read the previously persisted information.
	GetRequestDetails(ctx context.Context, name string) (*VolumeOperationRequestDetails, error)
	// StoreRequestDetails persists the details of the operation taking
	// place on the volume.
	// Returns an error if any error is encountered. Clients must assume
	// that the attempt to persist the information failed if an error is returned.
	StoreRequestDetails(ctx context.Context, instance *VolumeOperationRequestDetails) error
	// DeleteRequestDetails deletes the details of the operation on the volume
	// that was persisted by the VolumeOperationRequest interface.
	DeleteRequestDetails(ctx context.Context, name string) error
}

VolumeOperationRequest is an interface that supports handling idempotency in CSI volume manager. This interface persists operation details invoked on CNS and returns the persisted information to callers whenever it is requested.

func InitVolumeOperationRequestInterface

func InitVolumeOperationRequestInterface(ctx context.Context, cleanupInterval int,
	isBlockVolumeSnapshotEnabled func() bool) (VolumeOperationRequest, error)

InitVolumeOperationRequestInterface creates the CnsVolumeOperationRequest definition on the API server and returns an implementation of VolumeOperationRequest interface. Clients are unaware of the implementation details to read and persist volume operation details.

type VolumeOperationRequestDetails

type VolumeOperationRequestDetails struct {
	Name             string
	VolumeID         string
	SnapshotID       string
	Capacity         int64
	OperationDetails *OperationDetails
}

VolumeOperationRequestDetails stores details about a single operation on the given volume. These details are persisted by VolumeOperationRequestInterface and the persisted details will be returned by the interface on request by the caller via this structure.

func CreateVolumeOperationRequestDetails

func CreateVolumeOperationRequestDetails(name, volumeID, snapshotID string, capacity int64,
	taskInvocationTimestamp metav1.Time, taskID, vCenterServer, opID,
	taskStatus, error string) *VolumeOperationRequestDetails

CreateVolumeOperationRequestDetails returns an object of type VolumeOperationRequestDetails from the input parameters.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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