[skip ci]Implement get nodes by node type in getMetrics (#8892)

Signed-off-by: yanliang567 <yanliang.qiao@zilliz.com>
This commit is contained in:
yanliang567 2021-09-29 19:46:06 +08:00 committed by GitHub
parent a356a7a9a9
commit 09eb1ca21b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -73,6 +73,11 @@ class MilvusSys:
"""get all the nodes in Milvus deployment"""
return json.loads(self.sys_info.response).get('nodes_info')
@property
def get_nodes_by_type(self, node_type=None):
return NotImplementedError
target_nodes = []
if node_type is not None:
for node in self.nodes:
if str(node_type).lower() == str(node.get('infos').get('type')).lower():
target_nodes.append(node)
return target_nodes