vsphere

package
v1.14.16-dcf8320c8c4e Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 21 Imported by: 4

Documentation

Overview

Package vsphere provides a cluster-destroyer for vsphere clusters

Package vsphere provides a cluster-destroyer for vsphere clusters.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

New returns an VSphere destroyer from ClusterMetadata.

Types

type API

type API interface {
	Logout()
	ListFolders(ctx context.Context, tagID string) ([]mo.Folder, error)
	ListVirtualMachines(ctx context.Context, tagID string) ([]mo.VirtualMachine, error)
	StopVirtualMachine(ctx context.Context, vmMO mo.VirtualMachine) error
	DeleteFolder(ctx context.Context, f mo.Folder) error
	DeleteVirtualMachine(ctx context.Context, vmMO mo.VirtualMachine) error
	DeleteStoragePolicy(ctx context.Context, policyName string) error
	DeleteTag(ctx context.Context, id string) error
	DeleteTagCategory(ctx context.Context, id string) error
}

API represents the calls made to the API.

type Client

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

Client makes calls to the Azure API.

func NewClient

func NewClient(vCenter, username, password string) (*Client, error)

NewClient initializes a client. Logout() must be called when you are done with the client.

func (*Client) DeleteFolder

func (c *Client) DeleteFolder(ctx context.Context, f mo.Folder) error

DeleteFolder deletes a Folder.

func (*Client) DeleteStoragePolicy

func (c *Client) DeleteStoragePolicy(ctx context.Context, policyName string) error

DeleteStoragePolicy deletes a Storage Policy named `policyName`.

func (*Client) DeleteTag

func (c *Client) DeleteTag(ctx context.Context, id string) error

DeleteTag deletes a Tag named `id`.

func (*Client) DeleteTagCategory

func (c *Client) DeleteTagCategory(ctx context.Context, categoryName string) error

DeleteTagCategory deletes a Tag Category named `categoryName`.

func (*Client) DeleteVirtualMachine

func (c *Client) DeleteVirtualMachine(ctx context.Context, vmMO mo.VirtualMachine) error

DeleteVirtualMachine deletes a VirtualMachine.

func (*Client) ListFolders

func (c *Client) ListFolders(ctx context.Context, tagID string) ([]mo.Folder, error)

ListFolders returns all ManagedObjects of type "Folder".

func (*Client) ListVirtualMachines

func (c *Client) ListVirtualMachines(ctx context.Context, tagID string) ([]mo.VirtualMachine, error)

ListVirtualMachines returns ManagedObjects of type "VirtualMachine".

func (*Client) Logout

func (c *Client) Logout()

Logout logs out from the clients used.

func (*Client) StopVirtualMachine

func (c *Client) StopVirtualMachine(ctx context.Context, vmMO mo.VirtualMachine) error

StopVirtualMachine stops a VM if it's not already powered off.

type ClusterUninstaller

type ClusterUninstaller struct {
	ClusterID string
	InfraID   string

	Logger logrus.FieldLogger
	// contains filtered or unexported fields
}

ClusterUninstaller holds the various options for the cluster we want to delete.

func (*ClusterUninstaller) Run

Run is the entrypoint to start the uninstall process.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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