Documentation ¶
Index ¶
- Constants
- func CheckForVcAuthFaults(err error, log logrus.FieldLogger) bool
- func CheckIfVirtualCenterConfigChanged(oldVcConfig *VirtualCenterConfig, newVcConfig *VirtualCenterConfig) bool
- func GetClusterFromParamsMap(params map[string]interface{}) (string, error)
- func GetPasswordFromParamsMap(params map[string]interface{}) (string, error)
- func GetPortFromParamsMap(params map[string]interface{}) (string, error)
- func GetStringFromParamsMap(params map[string]interface{}, key string) (string, error)
- func GetUserFromParamsMap(params map[string]interface{}) (string, error)
- func GetVirtualCenterFromParamsMap(params map[string]interface{}) (string, error)
- type CnsManager
- func (this *CnsManager) CreateVolume(ctx context.Context, createSpecList []cnstypes.CnsVolumeCreateSpec) (*object.Task, error)
- func (this *CnsManager) DeleteVolume(ctx context.Context, volumeIDList []cnstypes.CnsVolumeId, deleteDisk bool) (*object.Task, error)
- func (this *CnsManager) QueryVolume(ctx context.Context, queryFilter cnstypes.CnsQueryFilter) (*cnstypes.CnsQueryResult, error)
- func (this *CnsManager) ResetManager(vcenter *VirtualCenter, cnsClient *cns.Client)
- type VirtualCenter
- type VirtualCenterConfig
- type VslmManager
- func (this *VslmManager) Clone(ctx context.Context, id vim.ID, spec vim.VslmCloneSpec) (*vslm_vsom.Task, error)
- func (this *VslmManager) CreateDisk(ctx context.Context, spec vim.VslmCreateSpec) (*vslm_vsom.Task, error)
- func (this *VslmManager) CreateDiskFromSnapshot(ctx context.Context, id vim.ID, snapshotId vim.ID, name string, ...) (*vslm_vsom.Task, error)
- func (this *VslmManager) CreateSnapshot(ctx context.Context, id vim.ID, description string) (*vslm_vsom.Task, error)
- func (this *VslmManager) Delete(ctx context.Context, id vim.ID) (*vslm_vsom.Task, error)
- func (this *VslmManager) DeleteSnapshot(ctx context.Context, id vim.ID, snapshotToDelete vim.ID) (*vslm_vsom.Task, error)
- func (this *VslmManager) ListObjectsForSpec(ctx context.Context, query []vslmtypes.VslmVsoVStorageObjectQuerySpec, ...) (*vslmtypes.VslmVsoVStorageObjectQueryResult, error)
- func (this *VslmManager) ResetManager(vcenter *VirtualCenter, vsom *vslm_vsom.GlobalObjectManager)
- func (this *VslmManager) Retrieve(ctx context.Context, id vim.ID) (*vim.VStorageObject, error)
- func (this *VslmManager) RetrieveMetadata(ctx context.Context, id vim.ID, snapshotID *vim.ID, prefix string) ([]vim.KeyValue, error)
- func (this *VslmManager) RetrieveSnapshotDetails(ctx context.Context, id vim.ID, snapshotId vim.ID) (*vim.VStorageObjectSnapshotDetails, error)
- func (this *VslmManager) RetrieveSnapshotInfo(ctx context.Context, id vim.ID) ([]vim.VStorageObjectSnapshotInfoVStorageObjectSnapshot, error)
- func (this *VslmManager) UpdateMetadata(ctx context.Context, id vim.ID, metadata []vim.KeyValue, deleteKeys []string) (*vslm_vsom.Task, error)
Constants ¶
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 )
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 GetPortFromParamsMap ¶
func GetStringFromParamsMap ¶
func GetUserFromParamsMap ¶
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 GetVirtualCenter ¶
func GetVirtualCenter(ctx context.Context, config *VirtualCenterConfig, log logrus.FieldLogger) (*VirtualCenter, *vslm.GlobalObjectManager, *cns.Client, error)
func (*VirtualCenter) Connect ¶
func (this *VirtualCenter) Connect(ctx context.Context) (*vslm.GlobalObjectManager, *cns.Client, error)
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 (*VslmManager) CreateSnapshot ¶
func (*VslmManager) DeleteSnapshot ¶
func (*VslmManager) ListObjectsForSpec ¶
func (this *VslmManager) ListObjectsForSpec(ctx context.Context, query []vslmtypes.VslmVsoVStorageObjectQuerySpec, maxResult int32) (*vslmtypes.VslmVsoVStorageObjectQueryResult, error)
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 (*VslmManager) RetrieveSnapshotDetails ¶
func (this *VslmManager) RetrieveSnapshotDetails(ctx context.Context, id vim.ID, snapshotId vim.ID) (*vim.VStorageObjectSnapshotDetails, error)
func (*VslmManager) RetrieveSnapshotInfo ¶
func (this *VslmManager) RetrieveSnapshotInfo(ctx context.Context, id vim.ID) ([]vim.VStorageObjectSnapshotInfoVStorageObjectSnapshot, error)