vsphere

package
v0.55.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DatacenterFromID

func DatacenterFromID(client *govmomi.Client, id string) (*object.Datacenter, error)

Types

type Client added in v0.15.0

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

func NewClient added in v0.15.0

func NewClient(vmomi *govmomi.Client, datacenter string) Client

func (Client) GetRootFolder added in v0.15.0

func (c Client) GetRootFolder(filter string) (*object.Folder, error)

type Folder

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

Folder represents an inventory folder within vSphere.

func NewFolder

func NewFolder(folder *object.Folder, name string) Folder

func (Folder) Delete

func (f Folder) Delete() error

func (Folder) Name

func (f Folder) Name() string

func (Folder) Type added in v0.16.0

func (f Folder) Type() string

type Folders

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

func NewFolders

func NewFolders(client client, logger logger) Folders

func (Folders) List

func (v Folders) List(filter string, rType string) ([]common.Deletable, error)

List not only lists top-level folders, it also lists child and grandchild folders, and all VMs within those folders.

func (Folders) Type added in v0.32.0

func (f Folders) Type() string

type Leftovers

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

func NewLeftovers

func NewLeftovers(logger logger, vCenterIP, vCenterUser, vCenterPassword, vCenterDC string) (Leftovers, error)

NewLeftovers returns a new Leftovers for vSphere that can be used to list resources, list types, or delete resources for the provided account. It returns an error if the credentials provided are invalid or a client cannot be created.

func (Leftovers) Delete

func (l Leftovers) Delete(filter string) error

Delete will collect all resources that contain the provided filter in the resource's identifier, prompt you to confirm deletion (if enabled), and delete those that are selected.

func (Leftovers) DeleteByType added in v0.55.0

func (l Leftovers) DeleteByType(filter, rType string) error

DeleteByType will collect all resources of the provied type that contain the provided filter in the resource's identifier, prompt you to confirm deletion, and delete those that are selected.

func (Leftovers) List added in v0.16.0

func (l Leftovers) List(filter string)

List will print all the resources that contain the provided filter in the resource's identifier.

func (Leftovers) ListByType added in v0.55.0

func (l Leftovers) ListByType(filter, rType string)

ListByType defaults to List.

func (Leftovers) Types added in v0.32.0

func (l Leftovers) Types()

Types will print all the resource types that can be deleted on this IaaS.

type VirtualMachine added in v0.15.0

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

VirtualMachine represents a vm or template in vSphere.

func NewVirtualMachine added in v0.15.0

func NewVirtualMachine(vm *object.VirtualMachine) VirtualMachine

func (VirtualMachine) Delete added in v0.15.0

func (v VirtualMachine) Delete() error

Delete will shut off a VM, if it is powered on or suspended, and will delete a VM or template from inventory.

func (VirtualMachine) Name added in v0.15.0

func (v VirtualMachine) Name() string

func (VirtualMachine) Type added in v0.16.0

func (v VirtualMachine) Type() string

Jump to

Keyboard shortcuts

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