leftovers: github.com/genevievelesperance/leftovers/vsphere Index | Files

package vsphere

import "github.com/genevievelesperance/leftovers/vsphere"

Index

Package Files

client.go folder.go folders.go helpers.go leftovers.go logger.go virtual_machine.go

func DatacenterFromID Uses

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

type Client Uses

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

func NewClient Uses

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

func (Client) GetRootFolder Uses

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

type Folder Uses

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

Folder represents an inventory folder within vSphere.

func NewFolder Uses

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

func (Folder) Delete Uses

func (f Folder) Delete() error

func (Folder) Name Uses

func (f Folder) Name() string

func (Folder) Type Uses

func (f Folder) Type() string

type Folders Uses

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

func NewFolders Uses

func NewFolders(client client, logger logger) Folders

func (Folders) List Uses

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 Uses

func (f Folders) Type() string

type Leftovers Uses

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

func NewLeftovers Uses

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 Uses

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 Uses

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 Uses

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 Uses

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

ListByType defaults to List.

func (Leftovers) Types Uses

func (l Leftovers) Types()

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

type VirtualMachine Uses

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

VirtualMachine represents a vm or template in vSphere.

func NewVirtualMachine Uses

func NewVirtualMachine(vm *object.VirtualMachine) VirtualMachine

func (VirtualMachine) Delete Uses

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 Uses

func (v VirtualMachine) Name() string

func (VirtualMachine) Type Uses

func (v VirtualMachine) Type() string

Package vsphere imports 12 packages (graph). Updated 2019-09-30. Refresh now. Tools for package owners.