utils

package
v3.1.1-rc.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// DefaultQuerySnapshotLimit constant is already present in pkg/csi/service/common/constants.go
	// However, using that constant creates an import cycle.
	// TODO: Refactor to move all the constants into a top level directory.
	DefaultQuerySnapshotLimit = int64(128)
)

Variables

This section is empty.

Functions

func LogoutAllvCenterSessions added in v3.1.0

func LogoutAllvCenterSessions(ctx context.Context)

LogoutAllSessions will logout all vCenter sessions and disconnect vCenter client

func QuerySnapshotsUtil

func QuerySnapshotsUtil(ctx context.Context, m cnsvolume.Manager, snapshotQueryFilter cnstypes.CnsSnapshotQueryFilter,
	maxEntries int64) ([]cnstypes.CnsSnapshotQueryResultEntry, string, error)

QuerySnapshotsUtil helps invoke CNS QuerySnapshot API. The method takes in a snapshotQueryFilter that represents the criteria to retrieve the snapshots. The maxEntries represents the max number of results that the caller of this method can handle.

func QueryVolumeDetailsUtil

func QueryVolumeDetailsUtil(ctx context.Context, m cnsvolume.Manager, volumeIds []cnstypes.CnsVolumeId) (
	map[string]*CnsVolumeDetails, error)

QueryVolumeDetailsUtil queries Capacity in MB and datastore URL for the source volume with expected volume type.

func QueryVolumeUtil

func QueryVolumeUtil(ctx context.Context, m cnsvolume.Manager, queryFilter cnstypes.CnsQueryFilter,
	querySelection *cnstypes.CnsQuerySelection, useQueryVolumeAsync bool) (*cnstypes.CnsQueryResult, error)

QueryVolumeUtil helps to invoke query volume API based on the feature state set for using query async volume. If useQueryVolumeAsync is set to true, the function invokes CNS QueryVolumeAsync, otherwise it invokes synchronous QueryVolume API. The function also take volume manager instance, query filters, query selection as params. Returns queryResult when query volume succeeds, otherwise returns appropriate errors.

Types

type CnsVolumeDetails

type CnsVolumeDetails struct {
	VolumeID     string
	SizeInMB     int64
	DatastoreUrl string
	VolumeType   string
}

Jump to

Keyboard shortcuts

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