vmware

package
v0.0.0-...-5c77d07 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultConfig

func GetDefaultConfig() string

func NewClient

func NewClient(ctx context.Context, conf *Config) (*vim25.Client, error)

func PowerChange

func PowerChange(conf *Config, v *VirtualMachine, state string) error

func Run

func Run(conf *Config, f func(context.Context, *vim25.Client) error) error

Types

type Config

type Config struct {
	GovcURL        string `mapstructure:"GOVC_URL"`
	GovcUsername   string `mapstructure:"GOVC_USERNAME"`
	GovcPassword   string `mapstructure:"GOVC_PASSWORD"`
	GovcInsecure   bool   `mapstructure:"GOVC_INSECURE"`
	GovcDataCenter string `mapstructure:"GOVC_DATACENTER"`
	GovcDataStore  string `mapstructure:"GOVC_DATASTORE"`
	GovcNetwork    string `mapstructure:"GOVC_NETWORK"`
}

func LoadConfig

func LoadConfig(configPath string) (*Config, error)

type HostSystem

type HostSystem struct {
	Name       string
	UsedCPU    float64
	TotalCPU   float64
	FreeCPU    float64
	MemUsage   units.ByteSize
	FreeMemory units.ByteSize
	Storage    int32
	// contains filtered or unexported fields
}

func GethostInfos

func GethostInfos(conf *Config) ([]*HostSystem, error)

type VirtualMachine

type VirtualMachine struct {
	Name string

	OS       string
	IP       string
	CPU      int32
	Mem      int32
	Hostname string
	// contains filtered or unexported fields
}

func GetVM

func GetVM(conf *Config, name string) (*VirtualMachine, error)

GetVM - Retrieve a VirtualMachine from the given name

func ListVMs

func ListVMs(conf *Config) []*VirtualMachine

func (*VirtualMachine) GetPowerState

func (v *VirtualMachine) GetPowerState() string

func (*VirtualMachine) IsTemplate

func (v *VirtualMachine) IsTemplate() bool

Jump to

Keyboard shortcuts

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