Documentation ¶
Overview ¶
Package vsphere provides a cluster-destroyer for vsphere clusters
Package vsphere provides a cluster-destroyer for vsphere clusters.
Index ¶
- func New(logger logrus.FieldLogger, metadata *installertypes.ClusterMetadata) (providers.Destroyer, error)
- type API
- type Client
- func (c *Client) DeleteFolder(ctx context.Context, f mo.Folder) error
- func (c *Client) DeleteStoragePolicy(ctx context.Context, policyName string) error
- func (c *Client) DeleteTag(ctx context.Context, id string) error
- func (c *Client) DeleteTagCategory(ctx context.Context, categoryName string) error
- func (c *Client) DeleteVirtualMachine(ctx context.Context, vmMO mo.VirtualMachine) error
- func (c *Client) ListFolders(ctx context.Context, tagID string) ([]mo.Folder, error)
- func (c *Client) ListVirtualMachines(ctx context.Context, tagID string) ([]mo.VirtualMachine, error)
- func (c *Client) Logout()
- func (c *Client) StopVirtualMachine(ctx context.Context, vmMO mo.VirtualMachine) error
- type ClusterUninstaller
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(logger logrus.FieldLogger, metadata *installertypes.ClusterMetadata) (providers.Destroyer, error)
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 ¶
NewClient initializes a client. Logout() must be called when you are done with the client.
func (*Client) DeleteFolder ¶
DeleteFolder deletes a Folder.
func (*Client) DeleteStoragePolicy ¶
DeleteStoragePolicy deletes a Storage Policy named `policyName`.
func (*Client) DeleteTagCategory ¶
DeleteTagCategory deletes a Tag Category named `categoryName`.
func (*Client) DeleteVirtualMachine ¶
DeleteVirtualMachine deletes a VirtualMachine.
func (*Client) ListFolders ¶
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) StopVirtualMachine ¶
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 ¶
func (o *ClusterUninstaller) Run() (*installertypes.ClusterQuota, error)
Run is the entrypoint to start the uninstall process.