mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-07-01 11:13:50 +02:00
Add ressource ounts to node table
This commit is contained in:
parent
82af984023
commit
6f3e1ffbe3
@ -14,8 +14,14 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Node struct {
|
type Node struct {
|
||||||
Name string `json:"hostname"`
|
Name string `json:"hostname"`
|
||||||
States []string `json:"states"`
|
States []string `json:"states"`
|
||||||
|
CpusAllocated int `json:"cpusAllocated"`
|
||||||
|
CpusTotal int `json:"cpusTotal"`
|
||||||
|
MemoryAllocated int `json:"memoryAllocated"`
|
||||||
|
MemoryTotal int `json:"memoryTotal"`
|
||||||
|
GpusAllocated int `json:"gpusAllocated"`
|
||||||
|
GpusTotal int `json:"gpusTotal"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// updateNodeStatesRequest model
|
// updateNodeStatesRequest model
|
||||||
|
@ -3,6 +3,12 @@ CREATE TABLE "node" (
|
|||||||
hostname VARCHAR(255) NOT NULL,
|
hostname VARCHAR(255) NOT NULL,
|
||||||
cluster VARCHAR(255) NOT NULL,
|
cluster VARCHAR(255) NOT NULL,
|
||||||
subcluster VARCHAR(255) NOT NULL,
|
subcluster VARCHAR(255) NOT NULL,
|
||||||
|
cpus_allocated INTEGER NOT NULL,
|
||||||
|
cpus_total INTEGER NOT NULL,
|
||||||
|
memory_allocated INTEGER NOT NULL,
|
||||||
|
memory_total INTEGER NOT NULL,
|
||||||
|
gpus_allocated INTEGER NOT NULL,
|
||||||
|
gpus_total INTEGER NOT NULL,
|
||||||
node_state VARCHAR(255) NOT NULL
|
node_state VARCHAR(255) NOT NULL
|
||||||
CHECK (node_state IN (
|
CHECK (node_state IN (
|
||||||
'allocated', 'reserved', 'idle', 'mixed',
|
'allocated', 'reserved', 'idle', 'mixed',
|
||||||
|
@ -24,12 +24,18 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Node struct {
|
type Node struct {
|
||||||
ID int64 `json:"id" db:"id"`
|
ID int64 `json:"id" db:"id"`
|
||||||
Hostname string `json:"hostname" db:"hostname" example:"fritz"`
|
Hostname string `json:"hostname" db:"hostname" example:"fritz"`
|
||||||
Cluster string `json:"cluster" db:"cluster" example:"fritz"`
|
Cluster string `json:"cluster" db:"cluster" example:"fritz"`
|
||||||
SubCluster string `json:"subCluster" db:"subcluster" example:"main"`
|
SubCluster string `json:"subCluster" db:"subcluster" example:"main"`
|
||||||
NodeState NodeState `json:"nodeState" db:"node_state" example:"completed" enums:"completed,failed,cancelled,stopped,timeout,out_of_memory"`
|
NodeState NodeState `json:"nodeState" db:"node_state" example:"completed" enums:"completed,failed,cancelled,stopped,timeout,out_of_memory"`
|
||||||
HealthState MonitoringState `json:"healthState" db:"health_state" example:"completed" enums:"completed,failed,cancelled,stopped,timeout,out_of_memory"`
|
HealthState MonitoringState `json:"healthState" db:"health_state" example:"completed" enums:"completed,failed,cancelled,stopped,timeout,out_of_memory"`
|
||||||
RawMetaData []byte `json:"-" db:"meta_data"`
|
CpusAllocated int `json:"cpusAllocated" db:"cpus_allocated"`
|
||||||
MetaData map[string]string `json:"metaData"`
|
CpusTotal int `json:"cpusTotal" db:"cpus_total"`
|
||||||
|
MemoryAllocated int `json:"memoryAllocated" db:"memory_allocated"`
|
||||||
|
MemoryTotal int `json:"memoryTotal" db:"memory_total"`
|
||||||
|
GpusAllocated int `json:"gpusAllocated" db:"gpus_allocated"`
|
||||||
|
GpusTotal int `json:"gpusTotal" db:"gpus_total"`
|
||||||
|
RawMetaData []byte `json:"-" db:"meta_data"`
|
||||||
|
MetaData map[string]string `json:"metaData"`
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user