Parameter description
Attribute | Type | Description |
---|---|---|
job | str | Job ID |
task_name | str | Task 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. The maximum value is 100 |
Response description
The list_instances method returns a
ListResponse
object.For more information about attributes of the
Instance
object, see the description of theInstance
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 Instance classes |
Example
try:
# Get a Client object.
client = Client(...
...
job = "job-xxx"
task_name = "echo_task"
marker = ""
max_item = 100
round = 0
while marker or round == 0:
response = client.list_instances(job, task_name, marker, max_item)
marker = response.NextMarker
for instance in response.Items:
print (instance.InstanceId, instance.State)
round += 1
except ClientError, e:
print(e)