可用资源信息修改
Former-commit-id: 3673109dda69aa2e8984dd89fce484a0dc9dc886
This commit is contained in:
parent
ae43d349a3
commit
2895446a75
|
@ -477,7 +477,7 @@ type NodeAssetsResp {
|
||||||
}
|
}
|
||||||
|
|
||||||
type NodeAsset {
|
type NodeAsset {
|
||||||
TenantName string `json:"tenantName"` //租户名称
|
Name string `json:"Name"` //租户名称
|
||||||
NodeName string `json:"NodeName"` // 节点名称
|
NodeName string `json:"NodeName"` // 节点名称
|
||||||
CpuTotal int64 `json:"CpuTotal"` // cpu核数
|
CpuTotal int64 `json:"CpuTotal"` // cpu核数
|
||||||
CpuUsable float64 `json:"CpuUsable"` // cpu可用率
|
CpuUsable float64 `json:"CpuUsable"` // cpu可用率
|
||||||
|
|
|
@ -26,7 +26,7 @@ func (l *NodeAssetsLogic) NodeAssets() (resp *types.NodeAssetsResp, err error) {
|
||||||
// 查询数据库系节点动态资源信息
|
// 查询数据库系节点动态资源信息
|
||||||
|
|
||||||
nodeResp := types.NodeAssetsResp{}
|
nodeResp := types.NodeAssetsResp{}
|
||||||
tx := l.svcCtx.DbEngin.Raw("SELECT ppi.`name`,nai.* FROM sc_node_avail_info nai left join sc_participant_phy_info ppi on ppi.id = nai.participant_id WHERE nai.id IN ( SELECT MAX( id ) FROM sc_node_avail_info WHERE deleted_flag = 0 GROUP BY participant_id, node_name)\n ").Scan(&nodeResp.NodeAssets)
|
tx := l.svcCtx.DbEngin.Raw("SELECT ppi.`name`,nai.* FROM sc_node_avail_info nai left join sc_participant_phy_info ppi on ppi.id = nai.participant_id WHERE nai.id IN ( SELECT MAX( id ) FROM sc_node_avail_info WHERE deleted_flag = 0 GROUP BY participant_id, node_name) ").Scan(&nodeResp.NodeAssets)
|
||||||
if tx.Error != nil {
|
if tx.Error != nil {
|
||||||
logx.Error(err)
|
logx.Error(err)
|
||||||
return nil, tx.Error
|
return nil, tx.Error
|
||||||
|
|
|
@ -446,7 +446,7 @@ type NodeAssetsResp struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type NodeAsset struct {
|
type NodeAsset struct {
|
||||||
TenantName string `json:"tenantName"` //租户名称
|
Name string `json:"Name"` //租户名称
|
||||||
NodeName string `json:"NodeName"` // 节点名称
|
NodeName string `json:"NodeName"` // 节点名称
|
||||||
CpuTotal int64 `json:"CpuTotal"` // cpu核数
|
CpuTotal int64 `json:"CpuTotal"` // cpu核数
|
||||||
CpuUsable float64 `json:"CpuUsable"` // cpu可用率
|
CpuUsable float64 `json:"CpuUsable"` // cpu可用率
|
||||||
|
|
Loading…
Reference in New Issue