package cluster

import "github.com/vmware/govmomi/vapi/cluster"

Index

Types

type Manager

type Manager struct {
	*rest.Client
}

Manager extends rest.Client, adding cluster related methods.

func NewManager

func NewManager(client *rest.Client) *Manager

NewManager creates a new Manager instance with the given client.

func (*Manager) AddModuleMembers

func (c *Manager) AddModuleMembers(ctx context.Context, id string, vms ...mo.Reference) (bool, error)

AddModuleMembers adds virtual machines to the module. These virtual machines are required to be in the same vCenter cluster. Returns true if all vms are added, false if a vm is already a member of the module or not within the module's cluster.

func (*Manager) CreateModule

func (c *Manager) CreateModule(ctx context.Context, ref mo.Reference) (string, error)

CreateModule creates a new module in a vCenter cluster.

func (*Manager) DeleteModule

func (c *Manager) DeleteModule(ctx context.Context, id string) error

DeleteModule deletes a specific module.

func (*Manager) ListModuleMembers

func (c *Manager) ListModuleMembers(ctx context.Context, id string) ([]types.ManagedObjectReference, error)

ListModuleMembers returns the virtual machines that are members of the module.

func (*Manager) ListModules

func (c *Manager) ListModules(ctx context.Context) ([]ModuleSummary, error)

ListModules returns information about the modules available in this vCenter server.

func (*Manager) RemoveModuleMembers

func (c *Manager) RemoveModuleMembers(ctx context.Context, id string, vms ...mo.Reference) (bool, error)

RemoveModuleMembers removes virtual machines from the module. Returns true if all vms are removed, false if a vm is not a member of the module.

type ModuleSummary

type ModuleSummary struct {
	Cluster string `json:"cluster"`
	Module  string `json:"module"`
}

ModuleSummary contains commonly used information about a module in a vCenter cluster.

type ModuleSummaryList

type ModuleSummaryList struct {
	Summaries []ModuleSummary `json:"summaries"`
}

ModuleSummaryList is used to JSON encode/decode a ModuleSummary.

Source Files

cluster.go

Directories

PathSynopsis
vapi/cluster/internal
vapi/cluster/simulator
Version
v0.48.1 (latest)
Published
Feb 11, 2025
Platform
linux/amd64
Imports
7 packages
Last checked
2 months ago

Tools for package owners.