Documentation ¶
Index ¶
- type DeployInfo
- type Session
- func (s *Session) DatastoreCapacity() (capacity, free float64, err error)
- func (s *Session) DeployOVATemplate(templatePath string) (DeployInfo, error)
- func (s *Session) DeployOVATemplates(templatePaths ...string) (map[string]DeployInfo, error)
- func (s *Session) GetDatacenterOrDefault(name string) (*object.Datacenter, error)
- func (s *Session) GetDatastoreOrDefault(name string) (*object.Datastore, error)
- func (s *Session) GetFolderOrDefault(name string) (*object.Folder, error)
- func (s *Session) GetNetworkOrDefault(name string) (object.NetworkReference, error)
- func (s *Session) GetResourcePoolOrDefault(name string) (*object.ResourcePool, error)
- func (s *Session) GetVM(name string) (*object.VirtualMachine, error)
- func (s *Session) GetVMTotalStorageSize(vmName string) (size float64, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeployInfo ¶
type DeployInfo struct { TemplateName string VMObject *object.VirtualMachine AlreadyExists bool }
DeployInfo is data for a deployed OVA
type Session ¶
type Session struct { Conn *govmomi.Client Datacenter *object.Datacenter Datastore *object.Datastore Folder *object.Folder ResourcePool *object.ResourcePool Network object.NetworkReference Ctx context.Context }
Session contains vsphere connection and object data
func NewClient ¶
func NewClient(ctx context.Context, server string, username string, password string) (*Session, error)
NewClient returns a new vsphere Session
func (*Session) DatastoreCapacity ¶
DatastoreCapacity gets the datastore capacity and free space in KB from vcenter and returns it in GB referenced from https://github.com/vmware/govmomi/blob/master/govc/datastore/info.go
func (*Session) DeployOVATemplate ¶
func (s *Session) DeployOVATemplate(templatePath string) (DeployInfo, error)
DeployOVATemplate uploads ova and makes it a template
func (*Session) DeployOVATemplates ¶
func (s *Session) DeployOVATemplates(templatePaths ...string) (map[string]DeployInfo, error)
DeployOVATemplates deploys multiple OVAs asynchronously
func (*Session) GetDatacenterOrDefault ¶
func (s *Session) GetDatacenterOrDefault(name string) (*object.Datacenter, error)
GetDatacenterOrDefault returns the govmomi object for a datacenter
func (*Session) GetDatastoreOrDefault ¶
GetDatastoreOrDefault returns the govmomi object for a datastore
func (*Session) GetFolderOrDefault ¶
GetFolderOrDefault returns a single folder object
func (*Session) GetNetworkOrDefault ¶
func (s *Session) GetNetworkOrDefault(name string) (object.NetworkReference, error)
GetNetworkOrDefault returns the govmomi object for a network
func (*Session) GetResourcePoolOrDefault ¶
func (s *Session) GetResourcePoolOrDefault(name string) (*object.ResourcePool, error)
GetResourcePoolOrDefault returns the govmomi object for a resource pool