library

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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

func GetCacheDirForLibraryItem(
	topLevelCacheDir, itemUUID, contentVersion string) string

GetCacheDirForLibraryItem returns the cache directory for a library item beneath a top-level cache directory.

func GetCachedFileNameForVMDK

func GetCachedFileNameForVMDK(vmdkFileName string) string

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.

Jump to

Keyboard shortcuts

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