Documentation ¶
Index ¶
- Constants
- func GetDatastoreRefByURLFromGivenDatastoreList(ctx context.Context, vc *cnsvsphere.VirtualCenter, ...) (*types.ManagedObjectReference, error)
- func QuerySnapshotsUtil(ctx context.Context, m cnsvolume.Manager, ...) ([]cnstypes.CnsSnapshotQueryResultEntry, string, error)
- func QueryVolumeDetailsUtil(ctx context.Context, m cnsvolume.Manager, volumeIds []cnstypes.CnsVolumeId) (map[string]*CnsVolumeDetails, error)
- func QueryVolumeUtil(ctx context.Context, m cnsvolume.Manager, queryFilter cnstypes.CnsQueryFilter, ...) (*cnstypes.CnsQueryResult, error)
- type CnsVolumeDetails
Constants ¶
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) // CnsQuerySelectionName_DATASTORE_URL is the name used to // retrieve datastore URL during a QueryVolumeAsync call. // TODO: Add this constant to govmomi along with the rest of the strings. CnsQuerySelectionName_DATASTORE_URL = "DATASTORE_URL" )
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.