描述
获取集群实例信息(get_cluster_instance)。
参数说明
| 属性 |
类型 |
描述 |
| cluster_id |
str |
集群标识符 |
| group_name |
str |
实例组名称 |
| instance_id |
str |
实例名称 |
返回值说明
get_cluster_instance方法将返回一个GetResponse 对象, 封装了ClusterInstance类型的所有接口。
ClusterInstance 类
参数说明
| 参数 |
类型 |
描述 |
| properties |
dict, str, ClusterInstance object |
集群实例状态信息 |
属性说明
| 属性 |
类型 |
描述 |
| Id |
str |
集群实例的标识符 |
| Hint |
str |
集群实例的亲和性信息,出现在AutoCluster中 |
| State |
str |
实例的状态,可能取值为:Pending,Starting,Running,Deleting,Deleted |
| IpAddress |
str |
集群实例网络地址 |
| CreationTime |
str |
集群实例的创建时间 |
示例
try: # Get a Client object. client = Client(... ... cluster_id = 'cls-xxxx' group_name = 'group1' instance_id = 'i-xxxx' instance_status = client.get_cluster_instance(cluster_id, group_name, instance_id) print(instance_status.Id, instance_status.IpAddress)except ClientError, e: print(e)