package model // NodeResponse is the API response for a node. type NodeResponse struct { // Identity Name string `json:"name"` // 节点主机名 State []string `json:"state"` // 节点状态 (e.g. ["IDLE"], ["ALLOCATED","COMPLETING"]) Reason string `json:"reason,omitempty"` // 节点 DOWN/DRAIN 的原因 ReasonSetByUser string `json:"reason_set_by_user,omitempty"` // 设置原因的用户 // CPU Resources CPUs int32 `json:"cpus"` // 总 CPU 核数 AllocCpus *int32 `json:"alloc_cpus,omitempty"` // 已分配 CPU 核数 Cores *int32 `json:"cores,omitempty"` // 物理核心数 Sockets *int32 `json:"sockets,omitempty"` // CPU 插槽数 Threads *int32 `json:"threads,omitempty"` // 每核线程数 CpuLoad *int32 `json:"cpu_load,omitempty"` // CPU 负载 (内核 nice 值乘以 100) // Memory (MiB) RealMemory int64 `json:"real_memory"` // 物理内存总量 AllocMemory int64 `json:"alloc_memory,omitempty"` // 已分配内存 FreeMem *int64 `json:"free_mem,omitempty"` // 空闲内存 // Hardware Arch string `json:"architecture,omitempty"` // 系统架构 (e.g. x86_64) OS string `json:"operating_system,omitempty"` // 操作系统版本 Gres string `json:"gres,omitempty"` // 可用通用资源 (e.g. "gpu:4") GresUsed string `json:"gres_used,omitempty"` // 已使用的通用资源 (e.g. "gpu:2") // Network Address string `json:"address,omitempty"` // 节点地址 (IP) Hostname string `json:"hostname,omitempty"` // 节点主机名 (可能与 Name 不同) // Scheduling Weight *int32 `json:"weight,omitempty"` // 调度权重 Features string `json:"features,omitempty"` // 节点特性标签 (可修改) ActiveFeatures string `json:"active_features,omitempty"` // 当前生效的特性标签 (只读) } // PartitionResponse is the API response for a partition. type PartitionResponse struct { // Identity Name string `json:"name"` // 分区名称 State []string `json:"state"` // 分区状态 (e.g. ["UP"], ["DOWN","DRAIN"]) Default bool `json:"default,omitempty"` // 是否为默认分区 // Nodes Nodes string `json:"nodes,omitempty"` // 分区包含的节点列表 TotalNodes int32 `json:"total_nodes,omitempty"` // 节点总数 // CPUs TotalCPUs int32 `json:"total_cpus,omitempty"` // CPU 总核数 MaxCPUsPerNode *int32 `json:"max_cpus_per_node,omitempty"` // 每节点最大 CPU 核数 // Limits MaxTime string `json:"max_time,omitempty"` // 最大运行时间 (分钟,"UNLIMITED" 表示无限) MaxNodes *int32 `json:"max_nodes,omitempty"` // 单作业最大节点数 MinNodes *int32 `json:"min_nodes,omitempty"` // 单作业最小节点数 DefaultTime string `json:"default_time,omitempty"` // 默认运行时间限制 GraceTime *int32 `json:"grace_time,omitempty"` // 作业抢占后的宽限时间 (秒) // Priority Priority *int32 `json:"priority,omitempty"` // 分区内作业优先级因子 // Access Control - QOS QOSAllowed string `json:"qos_allowed,omitempty"` // 允许使用的 QOS 列表 QOSDeny string `json:"qos_deny,omitempty"` // 禁止使用的 QOS 列表 QOSAssigned string `json:"qos_assigned,omitempty"` // 分区默认分配的 QOS // Access Control - Accounts AccountsAllowed string `json:"accounts_allowed,omitempty"` // 允许使用的账户列表 AccountsDeny string `json:"accounts_deny,omitempty"` // 禁止使用的账户列表 }