service

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBasicInventory

func CreateBasicInventory(
	vCenterID string,
	vms *[]vsphere.VM,
	infraData InfrastructureData,
) *api.Inventory

CreateBasicInventory creates a basic inventory object with the provided data This function consolidates the duplicated createBasicInventoryObj functions from vsphere.go and parser.go to ensure consistency and reduce duplication.

Types

type InfrastructureData

type InfrastructureData struct {
	Datastores            []api.Datastore
	Networks              []api.Network
	HostPowerStates       map[string]int
	Hosts                 *[]api.Host
	HostsPerCluster       []int
	ClustersPerDatacenter []int
	TotalHosts            int
	TotalClusters         int
	TotalDatacenters      int
	VmsPerCluster         []int
}

InfrastructureData contains all the infrastructure-related data needed to create an inventory

type InventoryData

type InventoryData struct {
	Inventory api.Inventory `json:"inventory"`
	Error     string        `json:"error"`
}

type InventoryUpdater

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

func NewInventoryUpdater

func NewInventoryUpdater(sourceID, agentID uuid.UUID, client client.Planner) *InventoryUpdater

func (*InventoryUpdater) UpdateServiceWithInventory

func (u *InventoryUpdater) UpdateServiceWithInventory(ctx context.Context, inventory *api.Inventory)

type StatusUpdater

type StatusUpdater struct {
	AgentID uuid.UUID
	// contains filtered or unexported fields
}

func NewStatusUpdater

func NewStatusUpdater(sourceID, agentID uuid.UUID, version, credUrl string, config *config.Config, client client.Planner) *StatusUpdater

func (*StatusUpdater) CalculateStatus

func (s *StatusUpdater) CalculateStatus() (api.AgentStatus, string, *api.Inventory)

func (*StatusUpdater) UpdateStatus

func (s *StatusUpdater) UpdateStatus(ctx context.Context, status api.AgentStatus, statusInfo string, credUrl string) error

Jump to

Keyboard shortcuts

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