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