Files
decort-golang-sdk/pkg/cloudbroker/resmon/models.go

92 lines
2.8 KiB
Go
Raw Normal View History

2025-03-11 13:09:17 +03:00
package resmon
// GetByComputeData represents an array of data points
type GetByComputeData []GetByComputePoint
type GetByComputePoint struct {
ID uint64 `json:"id"`
Name string `json:"name"`
ComputeID uint64 `json:"computeId"`
AccountID uint64 `json:"accountId"`
RGID uint64 `json:"rgId"`
Usage ComputeUsage `json:"usage"`
Disks []ItemDisk `json:"disks"`
UID string `json:"uid"`
2025-12-08 16:16:35 +03:00
NodeID uint64 `json:"nodeId"`
2025-03-11 13:09:17 +03:00
}
type ComputeUsage struct {
2026-07-10 15:37:02 +03:00
VCPUsConsumed uint64 `json:"vcpusConsumed"`
Storage uint64 `json:"storage"`
CPUTime float64 `json:"cpuTime"`
ExtIPs uint64 `json:"extips"`
RAMConsumed uint64 `json:"ramConsumed"`
VCPUsReserved uint64 `json:"vcpusReserved"`
IsUp bool `json:"isUp"`
RAMConsumedReal float64 `json:"ramConsumedReal"`
RAMReserved uint64 `json:"ramReserved"`
2025-03-11 13:09:17 +03:00
}
type ItemDisk struct {
2025-04-09 11:21:07 +03:00
ID uint64 `json:"id"`
Pool string `json:"pool"`
ResID string `json:"resId"`
SizeUsed float64 `json:"sizeUsed"`
SizeAvailable float64 `json:"sizeAvailable"`
2026-07-10 15:37:02 +03:00
SizeMax uint64 `json:"sizeMax"`
2025-03-11 13:09:17 +03:00
}
// GetByGRIDData represents an array of data points
type GetByGRIDData []GetByGRIDPoint
type GetByGRIDPoint struct {
UID string `json:"uid"`
Total ItemTotalByGRID `json:"total"`
Storages map[string]ItemStorage `json:"storages"`
}
type ItemTotalByGRID struct {
2026-07-10 15:37:02 +03:00
CPUPower float64 `json:"cpuPower"`
CPUUtil float64 `json:"cpuUtil"`
TotalMem float64 `json:"totalMem"`
ReservedMem float64 `json:"reservedMem"`
UsedMem float64 `json:"usedMem"`
FreeMem float64 `json:"freeMem"`
2025-03-11 13:09:17 +03:00
}
type ItemStorage struct {
2026-07-10 15:37:02 +03:00
UsedGiB uint64 `json:"usedGiB"`
TotalGiB uint64 `json:"totalGiB"`
2025-03-11 13:09:17 +03:00
}
2025-12-08 16:16:35 +03:00
// GetByNodeData represents an array of data points
type GetByNodeData []GetByNodePoint
2025-03-11 13:09:17 +03:00
2025-12-08 16:16:35 +03:00
type GetByNodePoint struct {
Usage NodeUsage `json:"usage"`
CPUInfo CPUinfoByNode `json:"cpuInfo"`
Name string `json:"name"`
ID uint64 `json:"id"`
2026-07-10 15:37:02 +03:00
UID string `json:"uid"`
2025-03-11 13:09:17 +03:00
}
2025-12-08 16:16:35 +03:00
type NodeUsage struct {
2026-07-10 15:37:02 +03:00
CPUPower uint64 `json:"cpuPower"`
UsedVCPUs uint64 `json:"usedVcpus"`
PCPU float64 `json:"pcpu"`
UsedMem uint64 `json:"usedMem"`
CPUUtil float64 `json:"cpuUtil"`
ReservedMem uint64 `json:"reservedMem"`
FreeMem uint64 `json:"freeMem"`
2025-03-11 13:09:17 +03:00
}
2025-12-08 16:16:35 +03:00
type CPUinfoByNode struct {
2026-07-10 15:37:02 +03:00
ClockSpeed uint64 `json:"clockSpeed"`
CoreCount uint64 `json:"coreCount"`
PhysCount uint64 `json:"physCount"`
ThreadCount uint64 `json:"threadCount"`
ModelName string `json:"model_name"`
Flags []string `json:"flags"`
MaxSupportedGeneration string `json:"max_supported_generation"`
2025-03-11 13:09:17 +03:00
}