All Products
Search
Document Center

list_cluster_instances

Last Updated: May 14, 2018

Parameter description

Attribute Type Description
cluster_id str Cluster ID
group_name str Instance group name
next_marker str Start resource ID on the next page. The value is null for the last page
max_item_count int Maximum number of actually returned resources. The default value is 50, and the maximum value is 100

Response description

  • The list_cluster_instances method returns a ListResponse object, which contains a set of ClusterInstance objects.
  • For more information about attributes of the ClusterInstance object, see the description of the ClusterInstance class.
Attribute Type Description
NextMarker str Start resource ID on the next page. The value is null for the last page
Items list List of ClusterInstance classes

Example

  1. try:
  2. # Get a Client object.
  3. client = Client(...
  4. ...
  5. cluster_id = "cls-xxxx"
  6. group_name = "group1"
  7. marker = ""
  8. max_item = 100
  9. round = 0
  10. while marker or round != 0:
  11. response = client.list_cluster_instances(cluster_id, group_name, marker, max_item)
  12. marker = response.NextMarker
  13. for cluster_instance in response.Items:
  14. print (cluster_instance.Id, cluster_instance.IpAddress)
  15. round += 1
  16. except ClientError, e:
  17. print(e)