host

package
v0.0.0-...-884d9dc Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// Init host is in the initial state when enabled
	Init = iota

	// MonitoringMonitored host is being monitored (from monitored state)
	MonitoringMonitored

	// Monitored host has been successfully monitored
	Monitored

	// Error host has encountered an error ocurred while monitoring
	Error

	// Disabled host is disabled
	Disabled

	// MonitoringError host is being monitored (from error state)
	MonitoringError

	// MonitoringInit host is being monitored (from init state)
	MonitoringInit

	// MonitoringDisabled host is being monitored (from disabled state)
	MonitoringDisabled

	// Offline host is totally offline
	Offline
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Core

type Core struct {
	ID        int    `xml:"ID,omitempty"`
	CPUs      string `xml:"CPUS,omitempty"`
	Dedicated string `xml:"DEDICATED,omitempty"`
	Free      int    `xml:"FREE,omitempty"`
}

type Datastore

type Datastore struct {
	ID      int `xml:"ID,omitempty"`
	TotalMB int `xml:"TOTAL_MB,omitempty"`
	FreeMB  int `xml:"FREE_MB,omitempty"`
	UsedMB  int `xml:"USED_MB,omitempty"`
}

type Datastores

type Datastores struct {
	DiskUsage  int         `xml:"DISK_USAGE,omitempty"`
	FreeDisk   int         `xml:"FREE_DISK,omitempty"`
	MaxDisk    int         `xml:"MAX_DISK,omitempty"`
	UsedDisk   int         `xml:"USED_DISK,omitempty"`
	Datastores []Datastore `xml:"DS,omitempty"`
}

type Host

type Host struct {
	XMLName         xml.Name          `xml:"HOST"`
	ID              int               `xml:"ID,omitempty"`
	Name            string            `xml:"NAME"`
	StateRaw        int               `xml:"STATE,omitempty"`
	IMMAD           string            `xml:"IM_MAD,omitempty"`
	VMMAD           string            `xml:"VM_MAD,omitempty"`
	ClusterID       int               `xml:"CLUSTER_ID,omitempty"`
	Cluster         string            `xml:"CLUSTER,omitempty"`
	Share           Share             `xml:"HOST_SHARE,omitempty"`
	VMs             shared.EntitiesID `xml:"VMS,omitempty"`
	MonitoringInfos dyn.Template      `xml:"MONITORING,omitempty"`
	Template        Template          `xml:"TEMPLATE,omitempty"`
}

Host represents an OpenNebula Host

func (*Host) State

func (host *Host) State() (State, error)

State looks up the state of the image and returns the ImageState

func (*Host) StateString

func (host *Host) StateString() (string, error)

StateString returns the state in string format

type HugePage

type HugePage struct {
	Pages int `xml:"PAGES,omitempty"`
	Size  int `xml:"SIZE,omitempty"`
	Usage int `xml:"USAGE,omitempty"`
}

type Memory

type Memory struct {
	Distance string `xml:"DISTANCE,omitempty"`
	Total    int    `xml:"TOTAL,omitempty"`
	Usage    int    `xml:"USAGE,omitempty"`
}

type Monitoring

type Monitoring struct {
	XMLName xml.Name       `xml:"MONITORING_DATA"`
	Records []dyn.Template `xml:"MONITORING"`
}

Monitoring contains the monitoring records of a host

type NumaNode

type NumaNode struct {
	ID        int        `xml:"NODE_ID,omitempty"`
	Cores     []Core     `xml:"CORE,omitempty"`
	HugePages []HugePage `xml:"HUGEPAGE,omitempty"`
	Memories  []Memory   `xml:"MEMORY,omitempty"`
}

type PCIDevices

type PCIDevices struct {
	Address      string     `xml:"ADDRESS,omitempty"`
	Bus          string     `xml:"BUS,omitempty"`
	Class        string     `xml:"CLASS,omitempty"`
	ClassName    string     `xml:"CLASS_NAME,omitempty"`
	Device       string     `xml:"DEVICE,omitempty"`
	DeviceName   string     `xml:"DEVICE_NAME,omitempty"`
	Domain       string     `xml:"DOMAIN,omitempty"`
	Function     string     `xml:"FUNCTION,omitempty"`
	NumaNodes    []NumaNode `xml:"NUMA_NODE,omitempty"`
	ShortAddress string     `xml:"SHORT_ADDRESS,omitempty"`
	Slot         string     `xml:"SLOT,omitempty"`
	Type         string     `xml:"TYPE,omitempty"`
	Vendor       string     `xml:"VENDOR,omitempty"`
	VendorName   string     `xml:"VENDOR_NAME,omitempty"`
	VMID         int        `xml:"VMID,omitempty"`
}

type Pool

type Pool struct {
	XMLName xml.Name `xml:"HOST_POOL"`
	Hosts   []Host   `xml:"HOST"`
}

Pool represents an OpenNebula Host pool

type PoolMonitoring

type PoolMonitoring struct {
	XMLName xml.Name       `xml:"MONITORING_DATA"`
	Records []dyn.Template `xml:"MONITORING"`
}

PoolMonitoring contains the monitoring records of the hosts

type Share

type Share struct {
	MemUsage int `xml:"MEM_USAGE,omitempty"`
	CPUUsage int `xml:"CPU_USAGE,omitempty"`
	TotalMem int `xml:"TOTAL_MEM,omitempty"`
	TotalCPU int `xml:"TOTAL_CPU,omitempty"`

	MaxMem int `xml:"MAX_MEM,omitempty"`
	MaxCPU int `xml:"MAX_CPU,omitempty"`

	RunningVMs int          `xml:"RUNNING_VMS,omitempty"`
	Datastores Datastores   `xml:"DATASTORES,omitempty"`
	NumaNodes  []NumaNode   `xml:"NUMA_NODES>NODE,omitempty"`
	PCIDevices []PCIDevices `xml:"PCI_DEVICES>PCI,omitempty"`
}

type State

type State int

HostState is the state of an OpenNebula Host

func (State) String

func (s State) String() string

type Template

type Template struct {
	dyn.Template
}

Template is a host template

func NewTemplate

func NewTemplate() *Template

NewTemplate returns a new host Template object

func (*Template) Add

func (t *Template) Add(key keys.Template, value interface{})

Add adds a host template key, value pair

func (*Template) Get

func (t *Template) Get(key keys.Template) (string, error)

Get returns the string value for a host template

func (*Template) GetI

func (n *Template) GetI(key keys.Template) (int, error)

GetI returns the integer value for an host template key

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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