Documentation ¶
Index ¶
- func RemoveDatastorePrefix(path string) string
- type CloneConfig
- type ConnectConfig
- type CreateConfig
- type Datastore
- func (ds *Datastore) Delete(path string) error
- func (ds *Datastore) FileExists(path string) bool
- func (ds *Datastore) Info(params ...string) (*mo.Datastore, error)
- func (ds *Datastore) Name() string
- func (ds *Datastore) ResolvePath(path string) string
- func (ds *Datastore) UploadFile(src, dst string) error
- type Driver
- func (d *Driver) CreateVM(config *CreateConfig) (*VirtualMachine, error)
- func (d *Driver) FindDatastore(name string, host string) (*Datastore, error)
- func (d *Driver) FindFolder(name string) (*Folder, error)
- func (d *Driver) FindHost(name string) (*Host, error)
- func (d *Driver) FindResourcePool(cluster string, host string, name string) (*ResourcePool, error)
- func (d *Driver) FindVM(name string) (*VirtualMachine, error)
- func (d *Driver) NewDatastore(ref *types.ManagedObjectReference) *Datastore
- func (d *Driver) NewFolder(ref *types.ManagedObjectReference) *Folder
- func (d *Driver) NewHost(ref *types.ManagedObjectReference) *Host
- func (d *Driver) NewResourcePool(ref *types.ManagedObjectReference) *ResourcePool
- func (d *Driver) NewVM(ref *types.ManagedObjectReference) *VirtualMachine
- type Folder
- type HardwareConfig
- type Host
- type KeyInput
- type ResourcePool
- type VirtualMachine
- func (vm *VirtualMachine) AddCdrom(isoPath string) error
- func (vm *VirtualMachine) AddConfigParams(params map[string]string) error
- func (vm *VirtualMachine) AddFloppy(imgPath string) error
- func (vm *VirtualMachine) AddSATAController() error
- func (template *VirtualMachine) Clone(ctx context.Context, config *CloneConfig) (*VirtualMachine, error)
- func (vm *VirtualMachine) Configure(config *HardwareConfig) error
- func (vm *VirtualMachine) ConvertToTemplate() error
- func (vm *VirtualMachine) CreateCdrom(c *types.VirtualAHCIController) (*types.VirtualCdrom, error)
- func (vm *VirtualMachine) CreateSnapshot(name string) error
- func (vm *VirtualMachine) Destroy() error
- func (vm *VirtualMachine) Devices() (object.VirtualDeviceList, error)
- func (vm *VirtualMachine) FindSATAController() (*types.VirtualAHCIController, error)
- func (vm *VirtualMachine) GetDir() (string, error)
- func (vm *VirtualMachine) Info(params ...string) (*mo.VirtualMachine, error)
- func (vm *VirtualMachine) PowerOff() error
- func (vm *VirtualMachine) PowerOn() error
- func (vm *VirtualMachine) RemoveDevice(keepFiles bool, device ...types.BaseVirtualDevice) error
- func (vm *VirtualMachine) ResizeDisk(diskSize int64) error
- func (vm *VirtualMachine) SetBootOrder(order []string) error
- func (vm *VirtualMachine) StartShutdown() error
- func (vm *VirtualMachine) TypeOnKeyboard(input KeyInput) (int32, error)
- func (vm *VirtualMachine) WaitForIP(ctx context.Context) (string, error)
- func (vm *VirtualMachine) WaitForShutdown(ctx context.Context, timeout time.Duration) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RemoveDatastorePrefix ¶
Cuts out the datastore prefix Example: "[datastore1] file.ext" --> "file.ext"
Types ¶
type CloneConfig ¶
type ConnectConfig ¶
type CreateConfig ¶
type CreateConfig struct { DiskThinProvisioned bool DiskControllerType string // example: "scsi", "pvscsi" DiskSize int64 Annotation string Name string Folder string Cluster string Host string ResourcePool string Datastore string GuestOS string // example: otherGuest Network string // "" for default network NetworkCard string // example: vmxnet3 USBController bool Version uint // example: 10 }
type Datastore ¶
type Datastore struct {
// contains filtered or unexported fields
}
func (*Datastore) FileExists ¶
func (*Datastore) ResolvePath ¶
func (*Datastore) UploadFile ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
func NewDriver ¶
func NewDriver(config *ConnectConfig) (*Driver, error)
func (*Driver) CreateVM ¶
func (d *Driver) CreateVM(config *CreateConfig) (*VirtualMachine, error)
func (*Driver) FindDatastore ¶
If name is an empty string, then resolve host's one
func (*Driver) FindResourcePool ¶
func (*Driver) NewDatastore ¶
func (d *Driver) NewDatastore(ref *types.ManagedObjectReference) *Datastore
func (*Driver) NewResourcePool ¶
func (d *Driver) NewResourcePool(ref *types.ManagedObjectReference) *ResourcePool
func (*Driver) NewVM ¶
func (d *Driver) NewVM(ref *types.ManagedObjectReference) *VirtualMachine
type HardwareConfig ¶
type ResourcePool ¶
type ResourcePool struct {
// contains filtered or unexported fields
}
func (*ResourcePool) Info ¶
func (p *ResourcePool) Info(params ...string) (*mo.ResourcePool, error)
func (*ResourcePool) Path ¶
func (p *ResourcePool) Path() (string, error)
type VirtualMachine ¶
type VirtualMachine struct {
// contains filtered or unexported fields
}
func (*VirtualMachine) AddCdrom ¶
func (vm *VirtualMachine) AddCdrom(isoPath string) error
func (*VirtualMachine) AddConfigParams ¶
func (vm *VirtualMachine) AddConfigParams(params map[string]string) error
func (*VirtualMachine) AddFloppy ¶
func (vm *VirtualMachine) AddFloppy(imgPath string) error
func (*VirtualMachine) AddSATAController ¶
func (vm *VirtualMachine) AddSATAController() error
func (*VirtualMachine) Clone ¶
func (template *VirtualMachine) Clone(ctx context.Context, config *CloneConfig) (*VirtualMachine, error)
func (*VirtualMachine) Configure ¶
func (vm *VirtualMachine) Configure(config *HardwareConfig) error
func (*VirtualMachine) ConvertToTemplate ¶
func (vm *VirtualMachine) ConvertToTemplate() error
func (*VirtualMachine) CreateCdrom ¶
func (vm *VirtualMachine) CreateCdrom(c *types.VirtualAHCIController) (*types.VirtualCdrom, error)
func (*VirtualMachine) CreateSnapshot ¶
func (vm *VirtualMachine) CreateSnapshot(name string) error
func (*VirtualMachine) Destroy ¶
func (vm *VirtualMachine) Destroy() error
func (*VirtualMachine) Devices ¶
func (vm *VirtualMachine) Devices() (object.VirtualDeviceList, error)
func (*VirtualMachine) FindSATAController ¶
func (vm *VirtualMachine) FindSATAController() (*types.VirtualAHCIController, error)
func (*VirtualMachine) GetDir ¶
func (vm *VirtualMachine) GetDir() (string, error)
func (*VirtualMachine) Info ¶
func (vm *VirtualMachine) Info(params ...string) (*mo.VirtualMachine, error)
func (*VirtualMachine) PowerOff ¶
func (vm *VirtualMachine) PowerOff() error
func (*VirtualMachine) PowerOn ¶
func (vm *VirtualMachine) PowerOn() error
func (*VirtualMachine) RemoveDevice ¶
func (vm *VirtualMachine) RemoveDevice(keepFiles bool, device ...types.BaseVirtualDevice) error
func (*VirtualMachine) ResizeDisk ¶
func (vm *VirtualMachine) ResizeDisk(diskSize int64) error
func (*VirtualMachine) SetBootOrder ¶
func (vm *VirtualMachine) SetBootOrder(order []string) error
func (*VirtualMachine) StartShutdown ¶
func (vm *VirtualMachine) StartShutdown() error
func (*VirtualMachine) TypeOnKeyboard ¶
func (vm *VirtualMachine) TypeOnKeyboard(input KeyInput) (int32, error)
func (*VirtualMachine) WaitForIP ¶
func (vm *VirtualMachine) WaitForIP(ctx context.Context) (string, error)
func (*VirtualMachine) WaitForShutdown ¶
Click to show internal directories.
Click to hide internal directories.