driver

package
v2.0.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2018 License: MPL-2.0 Imports: 17 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RemoveDatastorePrefix

func RemoveDatastorePrefix(path string) string

Cuts out the datastore prefix Example: "[datastore1] file.ext" --> "file.ext"

Types

type CloneConfig

type CloneConfig struct {
	Name         string
	Folder       string
	Cluster      string
	Host         string
	ResourcePool string
	Datastore    string
	LinkedClone  bool
}

type ConnectConfig

type ConnectConfig struct {
	VCenterServer      string
	Username           string
	Password           string
	InsecureConnection bool
	Datacenter         string
}

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) Delete

func (ds *Datastore) Delete(path string) error

func (*Datastore) FileExists

func (ds *Datastore) FileExists(path string) bool

func (*Datastore) Info

func (ds *Datastore) Info(params ...string) (*mo.Datastore, error)

func (*Datastore) Name

func (ds *Datastore) Name() string

func (*Datastore) ResolvePath

func (ds *Datastore) ResolvePath(path string) string

func (*Datastore) UploadFile

func (ds *Datastore) UploadFile(src, dst string) error

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

func (d *Driver) FindDatastore(name string, host string) (*Datastore, error)

If name is an empty string, then resolve host's one

func (*Driver) FindFolder

func (d *Driver) FindFolder(name string) (*Folder, error)

func (*Driver) FindHost

func (d *Driver) FindHost(name string) (*Host, error)

func (*Driver) FindResourcePool

func (d *Driver) FindResourcePool(cluster string, host string, name string) (*ResourcePool, error)

func (*Driver) FindVM

func (d *Driver) FindVM(name string) (*VirtualMachine, error)

func (*Driver) NewDatastore

func (d *Driver) NewDatastore(ref *types.ManagedObjectReference) *Datastore

func (*Driver) NewFolder

func (d *Driver) NewFolder(ref *types.ManagedObjectReference) *Folder

func (*Driver) NewHost

func (d *Driver) NewHost(ref *types.ManagedObjectReference) *Host

func (*Driver) NewResourcePool

func (d *Driver) NewResourcePool(ref *types.ManagedObjectReference) *ResourcePool

func (*Driver) NewVM

type Folder

type Folder struct {
	// contains filtered or unexported fields
}

func (*Folder) Info

func (f *Folder) Info(params ...string) (*mo.Folder, error)

func (*Folder) Path

func (f *Folder) Path() (string, error)

type HardwareConfig

type HardwareConfig struct {
	CPUs                int32
	CPUReservation      int64
	CPULimit            int64
	RAM                 int64
	RAMReservation      int64
	RAMReserveAll       bool
	NestedHV            bool
	CpuHotAddEnabled    bool
	MemoryHotAddEnabled bool
}

type Host

type Host struct {
	// contains filtered or unexported fields
}

func (*Host) Info

func (h *Host) Info(params ...string) (*mo.HostSystem, error)

type KeyInput

type KeyInput struct {
	Message  string
	Scancode key.Code
	Alt      bool
	Ctrl     bool
	Shift    bool
}

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 (*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

func (vm *VirtualMachine) WaitForShutdown(ctx context.Context, timeout time.Duration) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL