utils

package
v2.5.3-rc.2 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultQuerySnapshotLimit = int64(128)

TODO: The constant QuerySnapshotLimit is already present in pkg/csi/service/common/constants.go However, using that constant creates a import cycle. Refactor to move all the constants into a top level directory.

Variables

This section is empty.

Functions

func GetDatastoreRefByURLFromGivenDatastoreList

func GetDatastoreRefByURLFromGivenDatastoreList(
	ctx context.Context, vc *cnsvsphere.VirtualCenter, datastoreList []types.ManagedObjectReference, dsURL string) (
	*types.ManagedObjectReference, error)

Get the datastore reference by datastore URL from a list of datastore references. If the datastore with dsURL can be found in the same datacenter as the given VC and it is also found in the given datastoreList, return the reference of the datastore. Otherwise, return error.

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)

Query 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 added in v2.5.0

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