ipa

package
v0.0.0-...-b0498e7 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockDevice

type BlockDevice struct {
	// Block device name (path).
	Name string `json:"name"`

	// Size in bytes.
	Size int64 `json:"size"`

	// Whether the device is a rotational disk.
	IsRotational bool `json:"rotational"`

	// Model (optional).
	Model string `json:"model,omitempty"`

	// Serial number (optional).
	Serial string `json:"serial,omitempty"`

	// WWN (optional).
	WWN string `json:"wwn,omitempty"`
}

type BootInfo

type BootInfo struct {
	// Boot mode the machine is currently in.
	CurrentBootMode BootMode `json:"current_boot_mode"`

	// MAC address of the PXE booting interface (if known).
	PXEInterface string `json:"pxe_interface,omitempty"`

	// The current host name.
	HostName string `json:"hostname"`
}

type BootMode

type BootMode string
const (
	UEFI   BootMode = "uefi"
	Legacy BootMode = "bios"
)

type Client

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

An Ironic client required for the agent to operate.

func NewClient

func NewClient(ironicEndpoint string, inspectorEndpoint string) (Client, error)

Create a new client, wrapping Ironic and Inspector clients.

type ConfigDrive

type ConfigDrive struct {
	// User data (typically an Ignition script).
	UserData string
}

type Inventory

type Inventory struct {
	// Information about the current boot.
	BootInfo BootInfo `json:"boot"`

	// List of block devices.
	BlockDevices []BlockDevice `json:"disks"`

	// List of network interfaces.
	NetworkInterfaces []NetworkInterface `json:"interfaces"`

	// Memory information
	Memory Memory `json:"memory"`

	// Processors information.
	Processors Processors `json:"cpu"`

	// System vendor information.
	SystemVendor SystemVendor `json:"system_vendor"`

	// BMC address (e.g. via ipmitool) - v4.
	BMCAddressV4 string `json:"bmc_address,omitempty"`

	// BMC address (e.g. via ipmitool) - v6.
	BMCAddressV6 string `json:"bmc_v6address,omitempty"`
}

Shorter version of the IPA inventory defined in https://docs.openstack.org/ironic-python-agent/latest/admin/how_it_works.html#hardware-inventory

type IronicAgent

type IronicAgent interface {
	GetInventory() (Inventory, error)

	ListDeploySteps() ([]Step, error)

	GetDeployStep(interfaceName, stepName string) (Step, error)

	ListCleanSteps() ([]Step, error)

	GetCleanStep(interfaceName, stepName string) (Step, error)
}

type Memory

type Memory struct {
	// Total memory in bytes as seen by the OS.
	Total int64 `json:"total"`

	// Physical memory in MiB as reported by DMI.
	PhysicalMiB int64 `json:"physical_mb"`
}

type NetworkInterface

type NetworkInterface struct {
	// Interface name.
	Name string `json:"name"`

	// MAC address.
	MACAddress string `json:"mac_address"`

	// The current IPv4 address (if any).
	IPv4Address string `json:"ipv4_address,omitempty"`

	// The current IPv6 address (if any).
	IPv6Address string `json:"ipv6_address,omitempty"`

	// Raw LLDP information (optional).
	LLDP []TLV `json:"lldp,omitempty"`
}

type Node

type Node struct {
	// Unique ID.
	UUID string `json:"uuid"`

	// Unique name (optional).
	Name string `json:"name,omitempty"`

	// Instance information. Use GetConfigDrive to extract configuration
	// drive information.
	InstanceInfo map[string]interface{} `json:"instance_info"`
}

Short version of an Ironic node.

func (Node) GetConfigDrive

func (node Node) GetConfigDrive() (ConfigDrive, error)

type Port

type Port struct {
	// Unique ID.
	UUID string `json:"uuid"`

	// MAC address
	MACAddress string `json:"address"`
}

Short version of an Ironic port.

type Processors

type Processors struct {
	// Core count.
	Count int `json:"count"`

	// Architecture.
	Architecture string `json:"architecture"`

	// Frequence in MHz.
	FrequencyMHz int `json:"frequency"`

	// Model name (optional).
	ModelName string `json:"model_name"`

	// CPU flags.
	Flags []string `json:"flags"`
}

type Step

type Step struct {
	// Interface name (use "deploy" if unsure").
	Interface string `json:"interface"`

	// Step name.
	Name string `json:"step"`

	// Priority. 0 to disable by default.
	Priority int `json:"priority"`

	// Function to execute.
	Execute func(Node, []Port) error `json:"-"`
}

An executable step.

type SystemVendor

type SystemVendor struct {
	ProductName  string `json:"product_name"`
	SerialNumber string `json:"serial_number"`
	Manufacturer string `json:"manufacturer"`
}

type TLV

type TLV [2]string

Jump to

Keyboard shortcuts

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