描述
获取集群列表(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 = 100
round = 0
while marker or round != 0:
response = client.list_clusters(marker, max_item)
marker = response.NextMarker
for cluster in response.Items:
print (cluster.Id, cluster.State)
round += 1
except ClientError, e:
print(e)