Documentation
¶
Index ¶
- func GenerateDomainXML(vmName, isoPath, diskPath string) ([]byte, error)
- func NewPlannerAgent(name, url string) (*plannerAgentLibvirt, error)
- func WaitForDomainState(duration time.Duration, domain *libvirt.Domain, ...) error
- type AgentApi
- func (a *AgentApi) GetCollectorStatus() (*CollectorStatus, error)
- func (a *AgentApi) Inventory() (*v1alpha1.Inventory, error)
- func (a *AgentApi) SetAgentMode(mode string) (*AgentStatus, error)
- func (a *AgentApi) StartCollector(vcenterURL, username, password string) (*CollectorStatus, int, error)
- func (a *AgentApi) Status() (*AgentStatus, error)
- type AgentApiCollectorStatus
- type AgentMode
- type AgentModeRequest
- type AgentStatus
- type Boot
- type CPU
- type CollectorStartRequest
- type CollectorStatus
- type Console
- type Devices
- type Disk
- type Domain
- type Driver
- type Features
- type Graphics
- type Interface
- type LibOS
- type LibOSInfo
- type Memory
- type Metadata
- type Model
- type NetSource
- type OS
- type PlannerAgent
- type Source
- type Target
- type Type
- type VCPU
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateDomainXML ¶ added in v0.5.0
func NewPlannerAgent ¶
NewPlannerAgent creates a new libvirt-based planner agent instance
func WaitForDomainState ¶
func WaitForDomainState(duration time.Duration, domain *libvirt.Domain, desiredState libvirt.DomainState) error
WaitForDomainState polls the libvirt domain state until the desired state is reached or a timeout occurs. It checks the state once every second.
Types ¶
type AgentApi ¶
type AgentApi struct {
// contains filtered or unexported fields
}
AgentApi provides a client to interact with the Planner Agent API
func DefaultAgentApi ¶
DefaultAgentApi creates an AgentApi client with a default HTTP client that skips TLS verification
func NewAgentApi ¶
NewAgentApi creates an AgentApi client with a custom HTTP client, useful for test customization
func (*AgentApi) GetCollectorStatus ¶ added in v0.5.0
func (a *AgentApi) GetCollectorStatus() (*CollectorStatus, error)
func (*AgentApi) SetAgentMode ¶ added in v0.5.0
func (a *AgentApi) SetAgentMode(mode string) (*AgentStatus, error)
func (*AgentApi) StartCollector ¶ added in v0.5.0
func (a *AgentApi) StartCollector(vcenterURL, username, password string) (*CollectorStatus, int, error)
func (*AgentApi) Status ¶
func (a *AgentApi) Status() (*AgentStatus, error)
Status retrieves the current status of the agent
type AgentApiCollectorStatus ¶ added in v0.5.0
type AgentApiCollectorStatus string
var ( CollectorStatusCollected AgentApiCollectorStatus = "collected" CollectorStatusError AgentApiCollectorStatus = "error" )
type AgentMode ¶ added in v0.5.0
type AgentMode string
var (
AgentModeConnected AgentMode = "connected"
)
type AgentModeRequest ¶ added in v0.5.0
type AgentModeRequest struct {
Mode string `json:"mode"`
}
type AgentStatus ¶ added in v0.5.0
type CollectorStartRequest ¶ added in v0.5.0
type CollectorStatus ¶ added in v0.5.0
type Domain ¶ added in v0.5.0
type Domain struct {
XMLName xml.Name `xml:"domain"`
Type string `xml:"type,attr"`
Name string `xml:"name"`
Memory Memory `xml:"memory"`
VCPU VCPU `xml:"vcpu"`
Metadata Metadata `xml:"metadata"`
OS OS `xml:"os"`
CPU CPU `xml:"cpu"`
Features Features `xml:"features"`
Devices Devices `xml:"devices"`
}
type Features ¶ added in v0.5.0
type Features struct {
ACPI struct{} `xml:"acpi"`
APIC struct{} `xml:"apic"`
}
type Metadata ¶ added in v0.5.0
type Metadata struct {
LibOSInfo LibOSInfo `xml:"libosinfo:libosinfo"`
}
type PlannerAgent ¶
type PlannerAgent interface {
DumpLogs(string)
DumpDataDir() error
GetIp() (string, error)
Run() error
Restart() error
Remove() error
}
PlannerAgent defines the interface for interacting with a planner agent instance
Click to show internal directories.
Click to hide internal directories.