vmware

package
v0.0.0-...-b425644 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultVMLocation = os.Getenv("HOME") + "/Documents/Virtual Machines.localized"
	Root              = os.Getenv("HOME") + "/.vmware"
	CloudVMLocation   = Root + "/vms"
	TemplatesPath     = Root + "/templates"
)

Functions

func CleanupTags

func CleanupTags() error

func DeleteSnapshot

func DeleteSnapshot(path string, name string) error

func DeleteVM

func DeleteVM(path_ string) error

func GetGuestIPAddress

func GetGuestIPAddress(vmx string) (string, error)

func RestoreSnapshot

func RestoreSnapshot(path string, name string) error

func Running

func Running() ([]string, error)

func Start

func Start(path string, gui bool) error

func Stop

func Stop(path string) error

func StoreTags

func StoreTags(tags Tags) error

func TakeSnapshot

func TakeSnapshot(path string, name string) error

func UpdateTag

func UpdateTag(tag *Tag) error

Types

type CloneOptions

type CloneOptions struct {
	Linked    bool
	Snapshot  string
	CloneName string
}

type Lease

type Lease struct {
	Ip               string
	HardwareEthernet string
	Starts           time.Time
	Ends             time.Time
}

type Leases

type Leases []*Lease

func AllLeases

func AllLeases() (Leases, error)

func ParseLeases

func ParseLeases(path string) (leases Leases, e error)

func (Leases) FindHardwareAddress

func (leases Leases) FindHardwareAddress(addr string) Leases

func (Leases) Len

func (leases Leases) Len() int

func (Leases) Less

func (leases Leases) Less(a, b int) bool

func (Leases) Lookup

func (leases Leases) Lookup(addr string) *Lease

func (Leases) Swap

func (leases Leases) Swap(a, b int)

type NetworkInterface

type NetworkInterface struct {
	Hostname  string
	Interface string
	IP        net.IP
	MAC       net.HardwareAddr
}

func LoadArpInterfaces

func LoadArpInterfaces() ([]*NetworkInterface, error)

func ParseArpData

func ParseArpData(s string) (ifs []*NetworkInterface)

type Snapshot

type Snapshot struct {
	Name string
}

func ListSnapshots

func ListSnapshots(path string) (snapshots []*Snapshot, e error)

type Tag

type Tag struct {
	VmId  string
	Key   string
	Value string
}

func (*Tag) Id

func (tag *Tag) Id() string

type Tags

type Tags []*Tag

func LoadTags

func LoadTags() (Tags, error)

func (Tags) Len

func (list Tags) Len() int

func (Tags) Less

func (list Tags) Less(a, b int) bool

func (Tags) Swap

func (list Tags) Swap(a, b int)

func (Tags) Update

func (list Tags) Update(tag *Tag) (Tags, error)

type Vm

type Vm struct {
	Path  string
	Tags  Tags
	State string
	IP    string
	Name  string
	// contains filtered or unexported fields
}

func Clone

func Clone(src string, dst string, opts *CloneOptions) (*Vm, error)

func Create

func Create(vm *Vm, snapshot string) (*Vm, error)

func (*Vm) Clone

func (vm *Vm) Clone(dst string, opts *CloneOptions) (*Vm, error)

func (*Vm) Delete

func (vm *Vm) Delete() error

func (*Vm) GuestIPAddress

func (vm *Vm) GuestIPAddress() (string, error)

func (*Vm) Id

func (vm *Vm) Id() string

func (*Vm) Ip

func (vm *Vm) Ip() (string, error)

func (*Vm) Matches

func (vm *Vm) Matches(q string) bool

func (*Vm) ModifyCpu

func (vm *Vm) ModifyCpu(cpus int) error

func (*Vm) ModifyMemory

func (vm *Vm) ModifyMemory(mem int) error

func (*Vm) RestoreSnapshot

func (vm *Vm) RestoreSnapshot(name string) error

func (*Vm) Running

func (vm *Vm) Running() (bool, error)

func (*Vm) Start

func (vm *Vm) Start() error

func (*Vm) StartWithGui

func (vm *Vm) StartWithGui() error

func (*Vm) StartedAt

func (vm *Vm) StartedAt() (started time.Time, e error)

func (*Vm) Stop

func (vm *Vm) Stop() error

func (*Vm) Vmx

func (vm *Vm) Vmx() (*Vmx, error)

type Vms

type Vms []*Vm

func All

func All() (Vms, error)

func AllTemplates

func AllTemplates() (vms Vms, e error)

func AllWithIPsAndTags

func AllWithIPsAndTags() (Vms, error)

func AllWithTemplates

func AllWithTemplates() (vms Vms, e error)

func FindVms

func FindVms(locations []string) (vms Vms, e error)

func List

func List() (vms Vms, e error)

func (Vms) FindFirst

func (list Vms) FindFirst(name string) *Vm

func (Vms) Len

func (list Vms) Len() int

func (Vms) Less

func (list Vms) Less(a, b int) bool

func (Vms) Search

func (list Vms) Search(name string) (vms Vms)

func (Vms) Swap

func (list Vms) Swap(a, b int)

type Vmx

type Vmx struct {
	MacAddress    string
	CleanShutdown bool
	SoftPowerOff  bool
	Memory        int
	Cpus          int
}

func (*Vmx) Parse

func (vmx *Vmx) Parse(path string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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