You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
383 lines
6.2 KiB
383 lines
6.2 KiB
package node
|
|
|
|
// Node summary
|
|
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"`
|
|
}
|
|
|
|
// Resource consumption of the node
|
|
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"`
|
|
}
|
|
|
|
// Free Resources Info
|
|
type FreeResourcesInfo struct {
|
|
// RAM
|
|
RAM float64 `json:"RAM"`
|
|
}
|
|
|
|
// Resources Info
|
|
type ResourcesInfo struct {
|
|
// RAM
|
|
RAM uint64 `json:"RAM"`
|
|
}
|
|
|
|
// Consumed Resources Info
|
|
type ConsumedResourcesInfo struct {
|
|
// RAM
|
|
RAM uint64 `json:"RAM"`
|
|
|
|
// Computes
|
|
Computes uint64 `json:"computes"`
|
|
|
|
// Routers
|
|
Routers uint64 `json:"routers"`
|
|
|
|
// VCPU
|
|
VCPU uint64 `json:"vCPU"`
|
|
}
|
|
|
|
// Information about node CPU
|
|
type CpuInfo struct {
|
|
// Clock Speed
|
|
ClockSpeed float64 `json:"clockSpeed"`
|
|
|
|
// CoreCount
|
|
CoreCount uint64 `json:"coreCount"`
|
|
|
|
// PhysCount
|
|
PhysCount uint64 `json:"physCount"`
|
|
}
|
|
|
|
// Main information about node
|
|
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"`
|
|
}
|
|
|
|
// Numa Topology Info
|
|
type NumaTopologyInfo struct {
|
|
// NodeNum
|
|
NodeNum uint64 `json:"nodenum"`
|
|
|
|
// Nodes
|
|
Nodes map[string]NodeInfo `json:"nodes"`
|
|
}
|
|
|
|
// Node Info from NumaTopologyInfo
|
|
type NodeInfo struct {
|
|
// CPUList
|
|
CPUList []uint64 `json:"cpulist"`
|
|
|
|
// Memory
|
|
Memory ItemMemory `json:"memory"`
|
|
}
|
|
|
|
type ItemMemory struct {
|
|
// 1G
|
|
OneG uint64 `json:"1G"`
|
|
|
|
// 2M
|
|
TwoM uint64 `json:"2M"`
|
|
|
|
// Total
|
|
Total uint64 `json:"total"`
|
|
}
|
|
|
|
type ListNicInfo []ItemNicInfo
|
|
|
|
// Item Nic Info
|
|
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"`
|
|
}
|
|
|
|
type ListNetAddr []ItemNetAddr
|
|
|
|
// Item Net Addr
|
|
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"`
|
|
}
|
|
|
|
// List of nodes
|
|
type ListNodes struct {
|
|
// Data
|
|
Data []ItemNode `json:"data"`
|
|
|
|
// Entry count
|
|
EntryCount uint64 `json:"entryCount"`
|
|
}
|
|
|
|
// Net address
|
|
type NetAddr struct {
|
|
// Name
|
|
Name string `json:"name"`
|
|
|
|
// IP list backplane1 node
|
|
IP []string `json:"ip"`
|
|
}
|
|
|
|
// DPDK info
|
|
type DPDK struct {
|
|
// Bridges
|
|
Bridges Bridges `json:"bridges"`
|
|
|
|
// hp memory
|
|
HPMemory map[string]uint64 `json:"hp_memory"`
|
|
|
|
// pmd cpu
|
|
PMDCPU []uint64 `json:"pmd_cpu"`
|
|
}
|
|
|
|
// Bridges
|
|
type Bridges struct {
|
|
Backplane1 Backplane1 `json:"backplane1"`
|
|
}
|
|
|
|
// Backplane1
|
|
type Backplane1 struct {
|
|
Interfaces []string `json:"interfaces"`
|
|
NumaNode uint64 `json:"numa_node"`
|
|
}
|
|
|
|
// Role
|
|
type Role struct {
|
|
Actor string `json:"actor"`
|
|
Reason string `json:"reason"`
|
|
Time uint64 `json:"time"`
|
|
}
|