Documentation ¶
Index ¶
- Constants
- Variables
- func GetNumberOfDatacenters(ctx context.Context, connection *icsgo.ICSConnection) (int, error)
- type Common
- type Datacenter
- func (dc *Datacenter) CreateFirstClassDisk(ctx context.Context, datastoreName string, datastoreType ParentDatastoreType, ...) error
- func (dc *Datacenter) DoesFirstClassDiskExist(ctx context.Context, fcdID string) (*FirstClassDiskInfo, error)
- func (dc *Datacenter) GetAllDatastores(ctx context.Context) (map[string]*DatastoreInfo, error)
- func (dc *Datacenter) GetDatastoreByName(ctx context.Context, name string) (*DatastoreInfo, error)
- func (dc *Datacenter) GetDatastoreByPath(ctx context.Context, vmDiskPath string) (*DatastoreInfo, error)
- func (dc *Datacenter) GetDatastoreClusterByName(ctx context.Context, name string) (*StoragePodInfo, error)
- func (dc *Datacenter) GetFirstClassDisk(ctx context.Context, datastoreName string, datastoreType ParentDatastoreType, ...) (*FirstClassDiskInfo, error)
- func (dc *Datacenter) GetVMByDNSName(ctx context.Context, dnsName string) (*VirtualMachine, error)
- func (dc *Datacenter) GetVMByIP(ctx context.Context, ipAddy string) (*VirtualMachine, error)
- func (dc *Datacenter) GetVMByPath(ctx context.Context, vmPath string) (*VirtualMachine, error)
- func (dc *Datacenter) GetVMByUUID(ctx context.Context, vmUUID string) (*VirtualMachine, error)
- type Datastore
- type DatastoreInfo
- type FindFCD
- type FirstClassDisk
- type FirstClassDiskInfo
- type HostSystem
- type ParentDatastoreType
- type StoragePod
- type StoragePodInfo
- type VirtualMachine
Constants ¶
const ( FileAlreadyExistErrMsg = "File requested already exist" NoDevicesFoundErrMsg = "No devices found" DiskNotFoundErrMsg = "No vSphere disk ID/Name found" InvalidVolumeOptionsErrMsg = "VolumeOptions verification failed" NoVMFoundErrMsg = "No VM found" NoZoneRegionFoundErrMsg = "Unable to find the Zone/Region pair" NoDatastoreFoundErrMsg = "Datastore not found" NoDatacenterFoundErrMsg = "Datacenter not found" NoDataStoreClustersFoundErrMsg = "No DatastoreClusters Found" )
Error Messages
Variables ¶
var ( ErrFileAlreadyExist = errors.New(FileAlreadyExistErrMsg) ErrNoDevicesFound = errors.New(NoDevicesFoundErrMsg) ErrNoDiskIDFound = errors.New(DiskNotFoundErrMsg) ErrInvalidVolumeOptions = errors.New(InvalidVolumeOptionsErrMsg) ErrNoVMFound = errors.New(NoVMFoundErrMsg) ErrNoZoneRegionFound = errors.New(NoZoneRegionFoundErrMsg) ErrNoDatastoreFound = errors.New(NoDatastoreFoundErrMsg) ErrNoDatacenterFound = errors.New(NoDatacenterFoundErrMsg) ErrNoDataStoreClustersFound = errors.New(NoDataStoreClustersFoundErrMsg) )
Error constants
Functions ¶
func GetNumberOfDatacenters ¶
GetNumberOfDatacenters returns the number of DataCenters in this vCenter
Types ¶
type Common ¶
type Common struct {
Con *icsgo.ICSConnection
}
Common contains the fields and functions common to all objects.
func NewCommon ¶
func NewCommon(con *icsgo.ICSConnection) Common
type Datacenter ¶
type Datacenter struct { Common *types.Datacenter }
Datacenter extends the govmomi Datacenter object
func GetAllDatacenter ¶
func GetAllDatacenter(ctx context.Context, connection *icsgo.ICSConnection) ([]*Datacenter, error)
GetAllDatacenter returns all the DataCenter Objects
func GetDatacenter ¶
func GetDatacenter(ctx context.Context, connection *icsgo.ICSConnection, datacenterPath string) (*Datacenter, error)
GetDatacenter returns the DataCenter Object for the given datacenterPath If datacenter is located in a folder, include full path to datacenter else just provide the datacenter name
func (*Datacenter) CreateFirstClassDisk ¶
func (dc *Datacenter) CreateFirstClassDisk(ctx context.Context, datastoreName string, datastoreType ParentDatastoreType, diskName string, diskSize int64) error
CreateFirstClassDisk creates a new first class disk.
func (*Datacenter) DoesFirstClassDiskExist ¶
func (dc *Datacenter) DoesFirstClassDiskExist(ctx context.Context, fcdID string) (*FirstClassDiskInfo, error)
DoesFirstClassDiskExist returns information about an FCD if it exists.
func (*Datacenter) GetAllDatastores ¶
func (dc *Datacenter) GetAllDatastores(ctx context.Context) (map[string]*DatastoreInfo, error)
GetAllDatastores gets the datastore URL to DatastoreInfo map for all the datastores in the datacenter.
func (*Datacenter) GetDatastoreByName ¶
func (dc *Datacenter) GetDatastoreByName(ctx context.Context, name string) (*DatastoreInfo, error)
GetDatastoreByName gets the Datastore object for the given datastore name
func (*Datacenter) GetDatastoreByPath ¶
func (dc *Datacenter) GetDatastoreByPath(ctx context.Context, vmDiskPath string) (*DatastoreInfo, error)
GetDatastoreByPath gets the Datastore object from the given vmDiskPath
func (*Datacenter) GetDatastoreClusterByName ¶
func (dc *Datacenter) GetDatastoreClusterByName(ctx context.Context, name string) (*StoragePodInfo, error)
GetDatastoreClusterByName gets the DatastoreCluster object for the given name
func (*Datacenter) GetFirstClassDisk ¶
func (dc *Datacenter) GetFirstClassDisk(ctx context.Context, datastoreName string, datastoreType ParentDatastoreType, diskID string, findBy FindFCD) (*FirstClassDiskInfo, error)
GetFirstClassDisk searches for an existing FCD.
func (*Datacenter) GetVMByDNSName ¶
func (dc *Datacenter) GetVMByDNSName(ctx context.Context, dnsName string) (*VirtualMachine, error)
GetVMByDNSName gets the VM object from the given dns name
func (*Datacenter) GetVMByIP ¶
func (dc *Datacenter) GetVMByIP(ctx context.Context, ipAddy string) (*VirtualMachine, error)
GetVMByIP gets the VM object from the given IP address
func (*Datacenter) GetVMByPath ¶
func (dc *Datacenter) GetVMByPath(ctx context.Context, vmPath string) (*VirtualMachine, error)
GetVMByPath gets the VM object from the given vmPath vmPath should be the full path to VM and not just the name
func (*Datacenter) GetVMByUUID ¶
func (dc *Datacenter) GetVMByUUID(ctx context.Context, vmUUID string) (*VirtualMachine, error)
GetVMByUUID gets the VM object from the given vmUUID
type Datastore ¶
type Datastore struct { Common *types.Storage Datacenter *Datacenter }
Datastore extends the govmomi Datastore object
type DatastoreInfo ¶
type DatastoreInfo struct {
*Datastore
}
DatastoreInfo is a structure to store the Datastore and it's Info.
func (*DatastoreInfo) GetFirstClassDiskInfo ¶
func (di *DatastoreInfo) GetFirstClassDiskInfo(ctx context.Context, diskID string, findBy FindFCD) (*FirstClassDiskInfo, error)
GetFirstClassDiskInfo gets a specific first class disks (FCD) on this datastore
type FindFCD ¶
type FindFCD int
FindFCD is the type that represents the types of searches used to discover FCDs.
type FirstClassDisk ¶
type FirstClassDisk struct { ID string Datacenter *Datacenter //*types.VStorageObject ParentType ParentDatastoreType Datastore *Datastore StoragePod *StoragePod }
FirstClassDisk extends the govmomi FirstClassDisk object
type FirstClassDiskInfo ¶
type FirstClassDiskInfo struct { *FirstClassDisk DatastoreInfo *DatastoreInfo StoragePodInfo *StoragePodInfo }
FirstClassDiskInfo extends the govmomi FirstClassDisk object
type HostSystem ¶
func GetHostSystemListByDC ¶
func GetHostSystemListByDC(ctx context.Context, connection *icsgo.ICSConnection, datacenterPath string) ([]*HostSystem, error)
GetDatacenter returns the DataCenter Object for the given datacenterPath If datacenter is located in a folder, include full path to datacenter else just provide the datacenter name
type ParentDatastoreType ¶
type ParentDatastoreType string
ParentDatastoreType represents the possible parent types of a datastore.
const ( // TypeDatastore is a datastore parent that's another datastore. TypeDatastore ParentDatastoreType = "Datastore" // TypeDatastoreCluster is a datastore parent that's a cluster. TypeDatastoreCluster ParentDatastoreType = "DatastoreCluster" )
type StoragePod ¶
type StoragePod struct { Datacenter *Datacenter //*object.StoragePod Datastores []*Datastore }
StoragePod extends the govmomi StoragePod object
type StoragePodInfo ¶
type StoragePodInfo struct { *StoragePod //Summary *types.StoragePodSummary //Config *types.StorageDrsConfigInfo DatastoreInfos []*DatastoreInfo }
StoragePodInfo is a structure to store the StoragePod and it's Info.
type VirtualMachine ¶
type VirtualMachine struct { Common *types.VirtualMachine Datacenter *Datacenter }
VirtualMachine extends the govmomi VirtualMachine object