描述
获取集群列表(list_clusters)。
参数说明
| 属性 | 类型 | 描述 |
|---|---|---|
| next_marker | str | 下一页起始资源标识符, 最后一页该值为空。 |
| max_item_count | int | 实际返回最大资源数量。默认值50,最大值100。 |
返回值说明
list_clusters方法返回一个
ListResponse对象,包含了Cluster对象的集合。请参阅Cluster类的描述,了解Cluster对象的属性。
| 属性 | 类型 | 描述 |
|---|---|---|
| NextMarker | str | 下一页起始资源标识符, 最后一页该值为空。 |
| Items | list | Cluster类型的列表 |
示例
try:# Get a Client object.client = Client(......marker = ""max_item = 100round = 0while marker or round != 0:response = client.list_clusters(marker, max_item)marker = response.NextMarkerfor cluster in response.Items:print (cluster.Id, cluster.State)round += 1except ClientError, e:print(e)