vsphere

package
v1.3.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultScheme is the default connection scheme.
	DefaultScheme = "https"
	// DefaultRoundTripperCount is the default SOAP round tripper count.
	DefaultRoundTripperCount = 3
	// DefaultVCClientTimeoutInMinutes is the default timeout value.
	DefaultVCClientTimeoutInMinutes = 30
	// DefaultAuthErrorRetryCount is the number of retries
	DefaultAuthErrorRetryCount = 1
	// DefaultInsecure is the current default value for insecure flag
	DefaultInsecure bool = true
)
View Source
const (
	HostVcParamKey     = "VirtualCenter"
	UserVcParamKey     = "user"
	PasswordVcParamKey = "password"
	PortVcParamKey     = "port"
	ClusterVcParamKey  = "cluster-id"
)

Keys for VCenter parameters

Variables

This section is empty.

Functions

func CheckForVcAuthFaults

func CheckForVcAuthFaults(err error, log logrus.FieldLogger) bool

func CheckIfVirtualCenterConfigChanged

func CheckIfVirtualCenterConfigChanged(oldVcConfig *VirtualCenterConfig, newVcConfig *VirtualCenterConfig) bool

Compare the vc configs, returns true if they are same else false

func GetClusterFromParamsMap

func GetClusterFromParamsMap(params map[string]interface{}) (string, error)

func GetPasswordFromParamsMap

func GetPasswordFromParamsMap(params map[string]interface{}) (string, error)

func GetPortFromParamsMap

func GetPortFromParamsMap(params map[string]interface{}) (string, error)

func GetStringFromParamsMap

func GetStringFromParamsMap(params map[string]interface{}, key string) (string, error)

func GetUserFromParamsMap

func GetUserFromParamsMap(params map[string]interface{}) (string, error)

func GetVirtualCenterFromParamsMap

func GetVirtualCenterFromParamsMap(params map[string]interface{}) (string, error)

Types

type CnsManager

type CnsManager struct {
	// contains filtered or unexported fields
}

CnsManager provides functionality to manage volumes.

func GetCnsManager

func GetCnsManager(ctx context.Context, vc *VirtualCenter, cnsClient *cns.Client, logger logrus.FieldLogger) (*CnsManager, error)

GetCnsManager returns the Manager instance.

func (*CnsManager) CreateVolume

func (this *CnsManager) CreateVolume(ctx context.Context, createSpecList []cnstypes.CnsVolumeCreateSpec) (*object.Task, error)

func (*CnsManager) DeleteVolume

func (this *CnsManager) DeleteVolume(ctx context.Context, volumeIDList []cnstypes.CnsVolumeId, deleteDisk bool) (*object.Task, error)

func (*CnsManager) QueryVolume

func (this *CnsManager) QueryVolume(ctx context.Context, queryFilter cnstypes.CnsQueryFilter) (*cnstypes.CnsQueryResult, error)

func (*CnsManager) ResetManager

func (this *CnsManager) ResetManager(vcenter *VirtualCenter, cnsClient *cns.Client)

type VirtualCenter

type VirtualCenter struct {
	// Config represents the virtual center configuration.
	Config *VirtualCenterConfig
	// Client represents the govmomi client instance for the connection.
	Client *govmomi.Client
	// CnsClient represents the CNS client instance.
	CnsClient *cns.Client
	// VslmClient  represents the VSLM client instance.
	VslmClient *vslm.GlobalObjectManager
	// contains filtered or unexported fields
}

VirtualCenter holds details of a virtual center instance.

func (*VirtualCenter) Connect

Connect establishes a new connection with vSphere with updated credentials If credentials are invalid then it fails the connection.

func (*VirtualCenter) Disconnect

func (this *VirtualCenter) Disconnect(ctx context.Context) error

Disconnect disconnects the virtual center host connection if connected.

type VirtualCenterConfig

type VirtualCenterConfig struct {
	// Scheme represents the connection scheme. (Ex: https)
	Scheme string
	// Host represents the virtual center host address.
	Host string
	// Port represents the virtual center host port.
	Port int
	// Username represents the virtual center username.
	Username string
	// Password represents the virtual center password in clear text.
	Password string
	// Cluster-id
	ClusterId string
	// RoundTripperCount is the SOAP round tripper count. (retries = RoundTripperCount - 1)
	RoundTripperCount int
	// VCClientTimeout is the time limit in minutes for requests made by vCenter client
	VCClientTimeout int
}

VirtualCenterConfig represents virtual center configuration.

func GetVirtualCenterConfigFromParams

func GetVirtualCenterConfigFromParams(params map[string]interface{}, logger logrus.FieldLogger) (*VirtualCenterConfig, error)

type VslmManager

type VslmManager struct {
	// contains filtered or unexported fields
}

VslmManager provides functionality to manage fcds.

func GetVslmManager

func GetVslmManager(
	ctx context.Context,
	vc *VirtualCenter,
	vsom *vslm_vsom.GlobalObjectManager,
	logger logrus.FieldLogger) (*VslmManager, error)

GetVslmManager returns the Manager instance.

func (*VslmManager) Clone

func (this *VslmManager) Clone(ctx context.Context, id vim.ID, spec vim.VslmCloneSpec) (*vslm_vsom.Task, error)

func (*VslmManager) CreateDisk

func (this *VslmManager) CreateDisk(ctx context.Context, spec vim.VslmCreateSpec) (*vslm_vsom.Task, error)

func (*VslmManager) CreateDiskFromSnapshot

func (this *VslmManager) CreateDiskFromSnapshot(ctx context.Context, id vim.ID, snapshotId vim.ID, name string, profile []vim.VirtualMachineProfileSpec, crypto *vim.CryptoSpec, path string) (*vslm_vsom.Task, error)

func (*VslmManager) CreateSnapshot

func (this *VslmManager) CreateSnapshot(ctx context.Context, id vim.ID, description string) (*vslm_vsom.Task, error)

func (*VslmManager) Delete

func (this *VslmManager) Delete(ctx context.Context, id vim.ID) (*vslm_vsom.Task, error)

func (*VslmManager) DeleteSnapshot

func (this *VslmManager) DeleteSnapshot(ctx context.Context, id vim.ID, snapshotToDelete vim.ID) (*vslm_vsom.Task, error)

func (*VslmManager) ListObjectsForSpec

func (*VslmManager) ResetManager

func (this *VslmManager) ResetManager(vcenter *VirtualCenter, vsom *vslm_vsom.GlobalObjectManager)

ResetManager helps set new manager instance and VC configuration

func (*VslmManager) Retrieve

func (this *VslmManager) Retrieve(ctx context.Context, id vim.ID) (*vim.VStorageObject, error)

func (*VslmManager) RetrieveMetadata

func (this *VslmManager) RetrieveMetadata(ctx context.Context, id vim.ID, snapshotID *vim.ID, prefix string) ([]vim.KeyValue, error)

func (*VslmManager) RetrieveSnapshotDetails

func (this *VslmManager) RetrieveSnapshotDetails(ctx context.Context, id vim.ID, snapshotId vim.ID) (*vim.VStorageObjectSnapshotDetails, error)

func (*VslmManager) RetrieveSnapshotInfo

func (*VslmManager) UpdateMetadata

func (this *VslmManager) UpdateMetadata(ctx context.Context, id vim.ID, metadata []vim.KeyValue, deleteKeys []string) (*vslm_vsom.Task, error)

Jump to

Keyboard shortcuts

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