Documentation
¶
Index ¶
- func CacheStorageURIs(ctx context.Context, client CacheStorageURIsClient, ...) ([]string, error)
- func GetCacheDirForLibraryItem(topLevelCacheDir, itemUUID, contentVersion string) string
- func GetCachedFileNameForVMDK(vmdkFileName string) string
- func GetTopLevelCacheDir(ctx context.Context, client GetTopLevelCacheDirClient, ...) (string, error)
- func SyncLibraryItem(ctx context.Context, client SyncLibraryItemClient, itemID string) error
- type CacheStorageURIsClient
- type GetTopLevelCacheDirClient
- type SyncLibraryItemClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheStorageURIs ¶
func CacheStorageURIs( ctx context.Context, client CacheStorageURIsClient, dstDatacenter, srcDatacenter *object.Datacenter, dstDir string, srcDiskURIs ...string) ([]string, error)
CacheStorageURIs copies the disk(s) from srcDiskURIs to dstDir and returns the path(s) to the copied disk(s).
func GetCacheDirForLibraryItem ¶
GetCacheDirForLibraryItem returns the cache directory for a library item beneath a top-level cache directory.
func GetCachedFileNameForVMDK ¶
GetCachedFileNameForVMDK returns the first 17 characters of a SHA-1 sum of a VMDK file name and extension, ex. my-disk.vmdk.
func GetTopLevelCacheDir ¶
func GetTopLevelCacheDir( ctx context.Context, client GetTopLevelCacheDirClient, dstDatacenter *object.Datacenter, dstDatastore *object.Datastore, dstDatastoreName, dstDatastoreURL string, topLevelDirectoryCreateSupported bool) (string, error)
GetTopLevelCacheDir returns the top-level cache directory at the root of the datastore. If the datastore uses vSAN, this function also ensures the top-level directory exists.
func SyncLibraryItem ¶
func SyncLibraryItem( ctx context.Context, client SyncLibraryItemClient, itemID string) error
SyncLibraryItem issues a sync call to the provided library item.
Types ¶
type CacheStorageURIsClient ¶
type CacheStorageURIsClient interface {
QueryVirtualDiskUuid(
ctx context.Context,
name string,
datacenter *object.Datacenter) (string, error)
CopyVirtualDisk(
ctx context.Context,
srcName string, srcDatacenter *object.Datacenter,
dstName string, dstDatacenter *object.Datacenter,
dstSpec vimtypes.BaseVirtualDiskSpec, force bool) (*object.Task, error)
MakeDirectory(
ctx context.Context,
name string,
datacenter *object.Datacenter,
createParentDirectories bool) error
WaitForTask(ctx context.Context, task *object.Task) error
}
CacheStorageURIsClient implements the client methods used by the CacheStorageURIs method.
type GetTopLevelCacheDirClient ¶
type GetTopLevelCacheDirClient interface {
CreateDirectory(
ctx context.Context,
datastore *object.Datastore,
displayName, policy string) (string, error)
ConvertNamespacePathToUuidPath(
ctx context.Context,
datacenter *object.Datacenter,
datastoreURL string) (string, error)
}
GetTopLevelCacheDirClient implements the client methods used by the GetTopLevelCacheDir method.
type SyncLibraryItemClient ¶
type SyncLibraryItemClient interface {
GetLibraryItem(ctx context.Context, id string) (*library.Item, error)
SyncLibraryItem(ctx context.Context, item *library.Item, force bool) error
}
SyncLibraryItemClient implements the client methods used by the SyncLibraryItem method.