node

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

API Actors for managing node. These actors are the final API for end users to manage nodes

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyIpmiActionRequest

type ApplyIpmiActionRequest struct {
	// Node ID
	// Required: true
	NID uint64 `url:"nid" json:"nid" validate:"required"`

	// Action
	// on of actions power_on shutdown force_shutdown reboot
	// Required: true
	Action string `url:"action" json:"action" validate:"required,action"`
}

ApplyIpmiActionRequest struct to apply ipmi action on node

type Backplane1 added in v1.10.1

type Backplane1 struct {
	Interfaces []string `json:"interfaces"`
	NumaNode   uint64   `json:"numa_node"`
}

Backplane1

type Bridges added in v1.10.1

type Bridges struct {
	Backplane1 Backplane1 `json:"backplane1"`
}

Bridges

type ConsumedResourcesInfo

type ConsumedResourcesInfo struct {
	// RAM
	RAM uint64 `json:"RAM"`

	// Computes
	Computes uint64 `json:"computes"`

	// Routers
	Routers uint64 `json:"routers"`

	// VCPU
	VCPU uint64 `json:"vCPU"`
}

Consumed Resources Info

type ConsumptionInfo

type ConsumptionInfo struct {
	// Consumed resources
	Consumed ConsumedResourcesInfo `json:"consumed"`

	// Free resources
	Free FreeResourcesInfo `json:"free"`

	// Hostname
	Hostname string `json:"hostname"`

	// Reserved resources
	Reserved ResourcesInfo `json:"reserved"`

	// Total resources
	Total ResourcesInfo `json:"total"`
}

Resource consumption of the node

type ConsumptionRequest

type ConsumptionRequest struct {
	// Node ID
	// Required: true
	NID uint64 `url:"nid" json:"nid" validate:"required"`
}

ConsumptionRequest struct to get node summary by resources and consumption

type CpuInfo

type CpuInfo struct {
	// Clock Speed
	ClockSpeed float64 `json:"clockSpeed"`

	// CoreCount
	CoreCount uint64 `json:"coreCount"`

	// PhysCount
	PhysCount uint64 `json:"physCount"`
}

Information about node CPU

type DPDK added in v1.10.1

type DPDK struct {
	// Bridges
	Bridges Bridges `json:"bridges"`

	// hp memory
	HPMemory map[string]uint64 `json:"hp_memory"`

	// pmd cpu
	PMDCPU []uint64 `json:"pmd_cpu"`
}

DPDK info

type DecommissionRequest

type DecommissionRequest struct {
	// Node ID
	// Required: true
	NID uint64 `url:"nid" json:"nid" validate:"required"`

	// Force node decommission
	// Default: false
	// Required: false
	Force bool `url:"force" json:"force"`
}

DecommissionRequest struct to set node status to DECOMMISSIONED

type EnableNodesRequest

type EnableNodesRequest struct {
	// List of Node IDs
	// Required: true
	NIDs []uint64 `url:"nids" json:"nids" validate:"required"`

	// Message
	// Required: false
	Message string `url:"message,omitempty" json:"message,omitempty"`
}

EnableNodesRequest struct to enable nodes from maintenance status to enabled

type EnableRequest

type EnableRequest struct {
	// Node ID
	// Required: true
	NID uint64 `url:"nid" json:"nid" validate:"required"`

	// Message
	// Required: false
	Message string `url:"message,omitempty" json:"message,omitempty"`

	// Do not check locks, iscsi-sessions or disk-present
	// Default: true
	// Required: false
	Force interface{} `url:"force" json:"force" validate:"isBool" `

	// Reason
	// Required: false
	Reason string `url:"reason,omitempty" json:"reason,omitempty"`
}

EnableRequest struct to enable node from maintenance status to enabled

type FreeResourcesInfo

type FreeResourcesInfo struct {
	// RAM
	RAM float64 `json:"RAM"`
}

Free Resources Info

type GetRequest

type GetRequest struct {
	// Node ID
	// Required: true
	NID uint64 `url:"nid" json:"nid" validate:"required"`
}

GetRequest struct to get detailed information about node

type ItemMemory

type ItemMemory struct {
	// 1G
	OneG uint64 `json:"1G"`

	// 2M
	TwoM uint64 `json:"2M"`

	// Total
	Total uint64 `json:"total"`
}

type ItemNetAddr

type ItemNetAddr struct {
	// CIDR
	CIDR []string `json:"cidr"`

	// Index
	Index uint64 `json:"index"`

	// IP
	IP []string `json:"ip"`

	// Mac
	Mac string `json:"mac"`

	// MTU
	MTU uint64 `json:"mtu"`

	// Name
	Name string `json:"name"`
}

Item Net Addr

type ItemNicInfo

type ItemNicInfo struct {
	// Driver
	Driver string `json:"driver"`

	// MaxVFS
	MaxVFS uint64 `json:"maxvfs"`

	// NumaNode
	NumaNode int64 `json:"numaNode"`

	// NumVFS
	NumVFS uint64 `json:"numvfs"`

	// OSName
	OSName string `json:"osName"`

	// PCISlot
	PCISlot string `json:"pciSlot"`

	// VFList
	VFList []interface{} `json:"vflist"`
}

Item Nic Info

type ItemNode

type ItemNode struct {
	// Additional packages
	AdditionalPkgs []interface{} `json:"additionalpkgs"`

	// CPU Info
	CpuInfo CpuInfo `json:"cpuInfo"`

	// Description
	Description string `json:"description"`

	// DPDK
	DPDK DPDK `json:"dpdk"`

	// GID
	GID uint64 `json:"gid"`

	// GUID
	GUID string `json:"guid"`

	// Hostkey
	HostKey string `json:"hostkey"`

	// ID
	ID uint64 `json:"id"`

	// IPAddr
	IPAddr []string `json:"ipaddr"`

	// Isolated Cpus
	IsolatedCpus []interface{} `json:"isolatedCpus"`

	// Last check
	LastCheck uint64 `json:"lastcheck"`

	// Machine GUID
	MachineGUID string `json:"machineguid"`

	// Mainboard SN
	MainboardSN string `json:"mainboardSN"`

	// Memory
	Memory uint64 `json:"memory"`

	// Milestones
	Milestones uint64 `json:"milestones"`

	// Model
	Model string `json:"model"`

	// Name
	Name string `json:"name"`

	// NeedReboot
	NeedReboot bool `json:"needReboot"`

	// NetAddr
	NetAddr ListNetAddr `json:"netaddr"`

	// Network mode
	NetworkMode string `json:"networkmode"`

	// Nic Info
	NicInfo ListNicInfo `json:"nicInfo"`

	// Node UUID
	NodeUUID string `json:"nodeUUID"`

	// NumaTopology
	NumaTopology NumaTopologyInfo `json:"numaTopology"`

	// PeerBackup
	PeerBackup uint64 `json:"peer_backup"`

	// PeerLog
	PeerLog uint64 `json:"peer_log"`

	// PeerStats
	PeerStats uint64 `json:"peer_stats"`

	// Pgpus
	Pgpus []uint64 `json:"pgpus"`

	// PublicKeys
	PublicKeys []string `json:"publickeys"`

	// Release
	Release string `json:"release"`

	// ReservedCPUs
	ReservedCPUs []interface{} `json:"reservedCpus"`

	// Roles
	Roles []string `json:"roles"`

	// Seps
	Seps []uint64 `json:"seps"`

	// SerialNum
	SerialNum string `json:"serialNum"`

	// SriovEnabled
	SriovEnabled bool `json:"sriovEnabled"`

	// StackID
	StackID uint64 `json:"stackId"`

	// Status
	Status string `json:"status"`

	// Tags
	Tags []string `json:"tags"`

	// Type
	Type string `json:"type"`

	//UEFI Firmware File
	UEFIFirmwareFile string `json:"uefiFirmwareFile"`

	// Version
	Version string `json:"version"`
}

Main information about node

func (ItemNode) Serialize

func (in ItemNode) Serialize(params ...string) (serialization.Serialized, error)

Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

In order to serialize with indent make sure to follow these guidelines:

  • First argument -> prefix
  • Second argument -> indent

type ListNetAddr

type ListNetAddr []ItemNetAddr

type ListNicInfo

type ListNicInfo []ItemNicInfo

type ListNodes

type ListNodes struct {
	// Data
	Data []ItemNode `json:"data"`

	// Entry count
	EntryCount uint64 `json:"entryCount"`
}

List of nodes

func (ListNodes) FilterByID

func (ln ListNodes) FilterByID(id uint64) ListNodes

FilterByID returns ListNodes with specified ID.

func (ListNodes) FilterByName

func (ln ListNodes) FilterByName(name string) ListNodes

FilterByName returns ListNodes with specified Name.

func (ListNodes) FilterByRelease

func (ln ListNodes) FilterByRelease(release string) ListNodes

FilterByRelease returns ListNodes with specified Release.

func (ListNodes) FilterByRole

func (ln ListNodes) FilterByRole(role string) ListNodes

FilterByRole returns ListNodes with specified Role.

func (ListNodes) FilterBySepID

func (ln ListNodes) FilterBySepID(sepId uint64) ListNodes

FilterBySepID returns ListNodes with specified Sep ID.

func (ListNodes) FilterByStatus

func (ln ListNodes) FilterByStatus(status string) ListNodes

FilterByStatus return ListNodes with specified status.

func (ListNodes) FilterByVersion

func (ln ListNodes) FilterByVersion(version string) ListNodes

FilterByVersion return ListNodes with specified version.

func (ListNodes) FilterFunc

func (ln ListNodes) FilterFunc(predicate func(ItemNode) bool) ListNodes

FilterFunc allows filtering ListNodes based on a user-specified predicate.

func (ListNodes) FindOne

func (ln ListNodes) FindOne() ItemNode

FindOne returns first found ItemNode. If none was found, returns an empty struct.

func (ListNodes) IDs

func (ln ListNodes) IDs() []uint64

IDs gets array of Node IDs from ListNodes struct

func (ListNodes) Serialize

func (ln ListNodes) Serialize(params ...string) (serialization.Serialized, error)

Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

In order to serialize with indent make sure to follow these guidelines:

  • First argument -> prefix
  • Second argument -> indent

type ListRequest

type ListRequest struct {
	// Find by node ID
	// Required: false
	ByID uint64 `url:"by_id,omitempty" json:"by_id,omitempty"`

	// Find by node name
	// Required: false
	Name string `url:"name,omitempty" json:"name,omitempty"`

	// Find by node version
	// Required: false
	Version string `url:"version,omitempty" json:"version,omitempty"`

	// Find by node release
	// Required: false
	Release string `url:"release,omitempty" json:"release,omitempty"`

	// Find by sep ID
	// Required: false
	SepID uint64 `url:"sepId,omitempty" json:"sepId,omitempty"`

	// Find by node roles
	// Required: false
	Role string `url:"role,omitempty" json:"role,omitempty"`

	// Find by node status
	// Required: false
	Status string `url:"status,omitempty" json:"status,omitempty"`

	// Sort by one of supported fields, format +|-(field)
	// Required: false
	SortBy string `url:"sortBy,omitempty" json:"sortBy,omitempty" validate:"omitempty,sortBy"`

	// Page number
	// Required: false
	Page uint64 `url:"page,omitempty" json:"page,omitempty"`

	// Page size
	// Required: false
	Size uint64 `url:"size,omitempty" json:"size,omitempty"`
}

ListRequest struct to get list of nodes

type MaintenanceRequest

type MaintenanceRequest struct {
	// Node ID
	// Required: true
	NID uint64 `url:"nid" json:"nid" validate:"required"`

	// VM Action
	// Default: stop
	// Required: false
	VMAction string `url:"vmaction,omitempty" json:"vmaction,omitempty" validate:"omitempty,vmaction"`

	// Offline
	// Default: false
	// Required: false
	Offline bool `url:"offline" json:"offline"`

	// VDiskAction
	// Required: false
	VDiskAction string `url:"vdiskaction,omitempty" json:"vdiskaction,omitempty"`

	// Reason
	// Required: false
	Reason string `url:"reason,omitempty" json:"reason,omitempty"`
}

MaintenanceRequest struct to place node in maintenance state

type NetAddr added in v1.10.0

type NetAddr struct {
	// Name
	Name string `json:"name"`

	// IP list backplane1 node
	IP []string `json:"ip"`
}

Net address

type Node

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

Structure for creating request to node

func New

func New(client interfaces.Caller) *Node

Builder for node endpoints

func (Node) ApplyIpmiAction

func (n Node) ApplyIpmiAction(ctx context.Context, req ApplyIpmiActionRequest) (string, error)

ApplyIpmiAction applies ipmi action on node

func (Node) Consumption

func (n Node) Consumption(ctx context.Context, req ConsumptionRequest) (*ConsumptionInfo, error)

Consumption gets node summary by resources and consumption

func (Node) Decommission

func (n Node) Decommission(ctx context.Context, req DecommissionRequest) (string, error)

Decommission sets node status to DECOMMISSIONED

func (Node) Enable

func (n Node) Enable(ctx context.Context, req EnableRequest) (string, error)

Enable enables node from maintenance status to enabled

func (Node) EnableAsync added in v1.9.0

func (n Node) EnableAsync(ctx context.Context, req EnableRequest) (string, error)

EnableAsync enables node from maintenance status to enabled with AsyncMode

func (Node) EnableNodes

func (n Node) EnableNodes(ctx context.Context, req EnableNodesRequest) (string, error)

EnableNodes enables nodes from maintenance status to enabled

func (Node) Get

func (n Node) Get(ctx context.Context, req GetRequest) (*RecordNode, error)

Get gets node summary as a RecordNode struct

func (Node) GetRaw

func (n Node) GetRaw(ctx context.Context, req GetRequest) ([]byte, error)

GetRaw gets node summary as an array of bytes

func (Node) List

func (n Node) List(ctx context.Context, req ListRequest) (*ListNodes, error)

List gets list of all nodes as a ListNodes struct

func (Node) ListRaw

func (n Node) ListRaw(ctx context.Context, req ListRequest) ([]byte, error)

ListRaw gets list of all nodes as an array of bytes

func (Node) Maintenance

func (n Node) Maintenance(ctx context.Context, req MaintenanceRequest) (string, error)

Maintenance places node in maintenance state

func (Node) Restrict

func (n Node) Restrict(ctx context.Context, req RestrictRequest) (string, error)

Restrict sets node status to 'RESTRICTED' and migrates node if migrate=True

func (Node) SetCoreIsolation

func (n Node) SetCoreIsolation(ctx context.Context, req SetCoreIsolationRequest) (string, error)

SetCoreIsolation isolates selected cores on node boot

func (Node) SetHugePages

func (n Node) SetHugePages(ctx context.Context, req SetHugePagesRequest) (string, error)

SetHugePages sets on-boot Huge Pages configuration

func (Node) SetSRIOVStatus

func (n Node) SetSRIOVStatus(ctx context.Context, req SetSRIOVStatusRequest) (string, error)

SetSRIOVStatus sets Single-root input/output virtualization kernel config on node

func (Node) SetVFsNumber

func (n Node) SetVFsNumber(ctx context.Context, req SetVFsNumberRequest) (string, error)

SetVFsNumber sets number of VFs for individual NIC on node

func (Node) Update

func (n Node) Update(ctx context.Context, req UpdateRequest) (string, error)

Update updates node for actual version

type NodeInfo

type NodeInfo struct {
	// CPUList
	CPUList []uint64 `json:"cpulist"`

	// Memory
	Memory ItemMemory `json:"memory"`
}

Node Info from NumaTopologyInfo

type NumaTopologyInfo

type NumaTopologyInfo struct {
	// NodeNum
	NodeNum uint64 `json:"nodenum"`

	// Nodes
	Nodes map[string]NodeInfo `json:"nodes"`
}

Numa Topology Info

type RecordNode

type RecordNode struct {
	// Consumption
	Consumption ConsumptionInfo `json:"consumption"`

	// CPU Info
	CpuInfo CpuInfo `json:"cpuInfo"`

	// CPU Allocation Ratio
	CPUAllocationRatio float64 `json:"cpu_allocation_ratio"`

	// DPDK info
	DPDK DPDK `json:"dpdk"`

	// GID
	GID uint64 `json:"gid"`

	// Node ID
	ID uint64 `json:"id"`

	// IPAddr
	IPAddr []string `json:"ipaddr"`

	// Isolated Cpus
	IsolatedCpus []interface{} `json:"isolatedCpus"`

	// Name
	Name string `json:"name"`

	// NeedReboot
	NeedReboot bool `json:"needReboot"`

	// Netaddr
	NetAddr NetAddr `json:"netaddr"`

	// Network mode
	NetworkMode string `json:"networkmode"`

	// Nic Info
	NicInfo ListNicInfo `json:"nicInfo"`

	// NumaTopology
	NumaTopology NumaTopologyInfo `json:"numaTopology"`

	// ReservedCPUs
	ReservedCPUs []interface{} `json:"reservedCpus"`

	// Roles
	Roles []string `json:"roles"`

	// SriovEnabled
	SriovEnabled bool `json:"sriovEnabled"`

	// StackID
	StackID uint64 `json:"stackId"`

	// Status
	Status string `json:"status"`

	// To active
	ToActive Role `json:"to_active"`

	// To installing
	ToInstalling Role `json:"to_installing"`

	// To maintenance
	ToMaintenance Role `json:"to_maintenance"`

	// To restricted
	ToRestricted Role `json:"to_restricted"`

	// Version
	Version string `json:"version"`
}

Node summary

func (RecordNode) Serialize

func (rn RecordNode) Serialize(params ...string) (serialization.Serialized, error)

Serialize returns JSON-serialized []byte. Used as a wrapper over json.Marshal and json.MarshalIndent functions.

In order to serialize with indent make sure to follow these guidelines:

  • First argument -> prefix
  • Second argument -> indent

type ResourcesInfo

type ResourcesInfo struct {
	// RAM
	RAM uint64 `json:"RAM"`
}

Resources Info

type RestrictRequest

type RestrictRequest struct {
	// Node ID
	// Required: true
	NID uint64 `url:"nid" json:"nid" validate:"required"`

	// Migrate node
	// Default: false
	// Required: false
	Migrate bool `url:"migrate" json:"migrate"`
}

RestrictRequest struct to set node status to 'RESTRICTED'

type Role added in v1.10.1

type Role struct {
	Actor  string `json:"actor"`
	Reason string `json:"reason"`
	Time   uint64 `json:"time"`
}

Role

type SetCoreIsolationRequest

type SetCoreIsolationRequest struct {
	// Node ID
	// Required: true
	NID uint64 `url:"nid" json:"nid" validate:"required"`

	// List of core number to isolate
	// Required: false
	CoreList []uint64 `url:"coreList,omitempty" json:"coreList,omitempty"`
}

SetCoreIsolationRequest struct to isolate selected cores on node boot

type SetHugePagesRequest

type SetHugePagesRequest struct {
	// Node ID
	// Required: true
	NID uint64 `url:"nid" json:"nid" validate:"required"`

	// Number of 2M hugepages to claim
	// Required: true
	HugePages2M uint64 `url:"hugepages2M" json:"hugepages2M" validate:"required"`

	// Number of 1G hugepages to claim
	// Required: true
	HugePages1G uint64 `url:"hugepages1G" json:"hugepages1G" validate:"required"`
}

SetHugePagesRequest struct to set on-boot Huge Pages configuration

type SetSRIOVStatusRequest

type SetSRIOVStatusRequest struct {
	// Node ID
	// Required: true
	NID uint64 `url:"nid" json:"nid" validate:"required"`

	// Enabled
	// Required: true
	Enabled bool `url:"enabled" json:"enabled" validate:"required"`
}

SetSRIOVStatusRequest struct to set Single-root input/output virtualization kernel config on node

type SetVFsNumberRequest

type SetVFsNumberRequest struct {
	// Node ID
	// Required: true
	NID uint64 `url:"nid" json:"nid" validate:"required"`

	// PCI address or NIC name
	// Required: true
	NicID string `url:"nicId" json:"nicId" validate:"required"`

	// Number of VF to assign
	// Required: true
	VFNum uint64 `url:"vfNum" json:"vfNum" validate:"required"`

	// Trust
	// Required: true
	Trust bool `url:"trust" json:"trust" validate:"required"`

	// Enable spoof checking
	// Required: true
	Spoofchk bool `url:"spoofchk" json:"spoofchk" validate:"required"`
}

SetVFsNumberRequest struct to set number of VFs for individual NIC on node

type UpdateRequest

type UpdateRequest struct {
	// List of Node IDs
	// Required: true
	NID uint64 `url:"nid" json:"nid" validate:"required"`
}

UpdateRequest struct to update node for actual version

Jump to

Keyboard shortcuts

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