Documentation
¶
Overview ¶
API Actors for managing node. These actors are the final API for end users to manage nodes
Index ¶
- type ApplyIpmiActionRequest
- type Backplane1
- type Bridges
- type ConsumedResourcesInfo
- type ConsumptionInfo
- type ConsumptionRequest
- type CpuInfo
- type DPDK
- type DecommissionRequest
- type EnableNodesRequest
- type EnableRequest
- type FreeResourcesInfo
- type GetRequest
- type ItemMemory
- type ItemNetAddr
- type ItemNicInfo
- type ItemNode
- type ListNetAddr
- type ListNicInfo
- type ListNodes
- func (ln ListNodes) FilterByID(id uint64) ListNodes
- func (ln ListNodes) FilterByName(name string) ListNodes
- func (ln ListNodes) FilterByRelease(release string) ListNodes
- func (ln ListNodes) FilterByRole(role string) ListNodes
- func (ln ListNodes) FilterBySepID(sepId uint64) ListNodes
- func (ln ListNodes) FilterByStatus(status string) ListNodes
- func (ln ListNodes) FilterByVersion(version string) ListNodes
- func (ln ListNodes) FilterFunc(predicate func(ItemNode) bool) ListNodes
- func (ln ListNodes) FindOne() ItemNode
- func (ln ListNodes) IDs() []uint64
- func (ln ListNodes) Serialize(params ...string) (serialization.Serialized, error)
- type ListRequest
- type MaintenanceRequest
- type NetAddr
- type Node
- func (n Node) ApplyIpmiAction(ctx context.Context, req ApplyIpmiActionRequest) (string, error)
- func (n Node) Consumption(ctx context.Context, req ConsumptionRequest) (*ConsumptionInfo, error)
- func (n Node) Decommission(ctx context.Context, req DecommissionRequest) (string, error)
- func (n Node) Enable(ctx context.Context, req EnableRequest) (string, error)
- func (n Node) EnableAsync(ctx context.Context, req EnableRequest) (string, error)
- func (n Node) EnableNodes(ctx context.Context, req EnableNodesRequest) (string, error)
- func (n Node) Get(ctx context.Context, req GetRequest) (*RecordNode, error)
- func (n Node) GetRaw(ctx context.Context, req GetRequest) ([]byte, error)
- func (n Node) List(ctx context.Context, req ListRequest) (*ListNodes, error)
- func (n Node) ListRaw(ctx context.Context, req ListRequest) ([]byte, error)
- func (n Node) Maintenance(ctx context.Context, req MaintenanceRequest) (string, error)
- func (n Node) Restrict(ctx context.Context, req RestrictRequest) (string, error)
- func (n Node) SetCoreIsolation(ctx context.Context, req SetCoreIsolationRequest) (string, error)
- func (n Node) SetHugePages(ctx context.Context, req SetHugePagesRequest) (string, error)
- func (n Node) SetSRIOVStatus(ctx context.Context, req SetSRIOVStatusRequest) (string, error)
- func (n Node) SetVFsNumber(ctx context.Context, req SetVFsNumberRequest) (string, error)
- func (n Node) Update(ctx context.Context, req UpdateRequest) (string, error)
- type NodeInfo
- type NumaTopologyInfo
- type RecordNode
- type ResourcesInfo
- type RestrictRequest
- type Role
- type SetCoreIsolationRequest
- type SetHugePagesRequest
- type SetSRIOVStatusRequest
- type SetVFsNumberRequest
- type UpdateRequest
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 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 ¶
FilterByID returns ListNodes with specified ID.
func (ListNodes) FilterByName ¶
FilterByName returns ListNodes with specified Name.
func (ListNodes) FilterByRelease ¶
FilterByRelease returns ListNodes with specified Release.
func (ListNodes) FilterByRole ¶
FilterByRole returns ListNodes with specified Role.
func (ListNodes) FilterBySepID ¶
FilterBySepID returns ListNodes with specified Sep ID.
func (ListNodes) FilterByStatus ¶
FilterByStatus return ListNodes with specified status.
func (ListNodes) FilterByVersion ¶
FilterByVersion return ListNodes with specified version.
func (ListNodes) FilterFunc ¶
FilterFunc allows filtering ListNodes based on a user-specified predicate.
func (ListNodes) FindOne ¶
FindOne returns first found ItemNode. If none was found, returns an empty 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 (Node) ApplyIpmiAction ¶
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 ¶
Decommission sets node status to DECOMMISSIONED
func (Node) EnableAsync ¶ added in v1.9.0
EnableAsync enables node from maintenance status to enabled with AsyncMode
func (Node) EnableNodes ¶
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) Maintenance ¶
Maintenance places node in maintenance state
func (Node) SetCoreIsolation ¶
SetCoreIsolation isolates selected cores on node boot
func (Node) SetHugePages ¶
SetHugePages sets on-boot Huge Pages configuration
func (Node) SetSRIOVStatus ¶
SetSRIOVStatus sets Single-root input/output virtualization kernel config on node
func (Node) SetVFsNumber ¶
SetVFsNumber sets number of VFs for individual NIC on node
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 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