janitor

package
v1.12.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package janitor implements a janitor for vSphere.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Janitor

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

Janitor implements a janitor for vSphere.

func NewJanitor

func NewJanitor(vSphereClients *VSphereClients, dryRun bool) *Janitor

NewJanitor creates a new Janitor.

func (*Janitor) CleanupVSphere

func (s *Janitor) CleanupVSphere(ctx context.Context, folders, resourcePools, vmFolders []string, skipClusterModule bool) error

CleanupVSphere cleans up vSphere VMs, folders and resource pools.

type NewVSphereClientsInput

type NewVSphereClientsInput struct {
	Password   string
	Server     string
	Thumbprint string
	UserAgent  string
	Username   string
}

NewVSphereClientsInput defines inputs for NewVSphereClients.

type VSphereClients

type VSphereClients struct {
	Vim           *vim25.Client
	Govmomi       *govmomi.Client
	Rest          *rest.Client
	FieldsManager *object.CustomFieldsManager
	Finder        *find.Finder
	ViewManager   *view.Manager
}

VSphereClients is a collection of different clients for vSphere.

func NewVSphereClients

func NewVSphereClients(ctx context.Context, input NewVSphereClientsInput) (*VSphereClients, error)

NewVSphereClients creates a VSphereClients object from the given input.

func (*VSphereClients) Logout

func (v *VSphereClients) Logout(ctx context.Context)

Logout logs out all clients. It logs errors if the context contains a logger.

Jump to

Keyboard shortcuts

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