提供查询某集群未安装的节点数量的API

This commit is contained in:
GoEdgeLab
2021-01-31 16:02:45 +08:00
parent 77b828839a
commit 4d1e8eb559
2 changed files with 24 additions and 2 deletions

View File

@@ -656,6 +656,15 @@ func (this *NodeDAO) FindAllEnabledNodesWithGrantId(tx *dbs.Tx, grantId int64) (
return
}
// 计算未安装的节点数量
func (this *NodeDAO) CountAllNotInstalledNodesWithClusterId(tx *dbs.Tx, clusterId int64) (int64, error) {
return this.Query(tx).
State(NodeStateEnabled).
Attr("clusterId", clusterId).
Attr("isInstalled", false).
Count()
}
// 查找所有未安装的节点
func (this *NodeDAO) FindAllNotInstalledNodesWithClusterId(tx *dbs.Tx, clusterId int64) (result []*Node, err error) {
_, err = this.Query(tx).