Documentation ¶
Index ¶
- type Session
- func (s *Session) DatastoreCapacity() (capacity, free float64, err error)
- func (s *Session) GetDatacenter(name string) (*object.Datacenter, error)
- func (s *Session) GetDatastore(name string) (*object.Datastore, error)
- func (s *Session) GetNetwork(name string) (object.NetworkReference, error)
- func (s *Session) GetResourcePool(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 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) GetDatacenter ¶
func (s *Session) GetDatacenter(name string) (*object.Datacenter, error)
GetDatacenter returns the govmomi object for a datacenter
func (*Session) GetDatastore ¶
GetDatastore returns the govmomi object for a datastore
func (*Session) GetNetwork ¶
func (s *Session) GetNetwork(name string) (object.NetworkReference, error)
GetNetwork returns the govmomi object for a network
func (*Session) GetResourcePool ¶
func (s *Session) GetResourcePool(name string) (*object.ResourcePool, error)
GetResourcePool returns the govmomi object for a resource pool
Click to show internal directories.
Click to hide internal directories.