Instance(实例)
更新时间:2022-05-18
查询实例列表
如下代码可查询指定集群和实例组的实例:
Python
1try:
2 response = bmr_client.list_instances(cluster_id, instance_group_id)
3 for instance in response.instances:
4 LOG.debug('list instances %s: %s' % (instance.id, instance))
5except BceHttpClientError as e:
6 if isinstance(e.last_error, BceServerError):
7 LOG.error('list_instances failed. Response %s, code: %s, msg: %s'
8 % (e.last_error.status_code, e.last_error.code, e.last_error.args))
9 else:
10 LOG.error('list_instances failed. Unknown exception: %s' % e)