list_container_instances
async
¶
list_container_instances(
*,
config_overrides: Optional[AsyncECSClientConfig] = None,
cluster: Optional[String] = None,
filter: Optional[String] = None,
next_token: Optional[String] = None,
max_results: Optional[BoxedInteger] = None,
status: Optional[ContainerInstanceStatus] = None,
) -> ListContainerInstancesResponse
Returns a list of container instances in a specified cluster. You can filter the results of a ListContainerInstances operation with cluster query language statements inside the filter parameter. For more information, see Cluster Query Language in the Amazon Elastic Container Service Developer Guide.
Parameters:
-
cluster(Optional[String], default:None) –The short name or full Amazon Resource Name (ARN) of the cluster that hosts the container instances to list. If you do not specify a cluster, the default cluster is assumed.
-
filter(Optional[String], default:None) –You can filter the results of a
ListContainerInstancesoperation with cluster query language statements. For more information, see Cluster Query Language in the Amazon Elastic Container Service Developer Guide. -
next_token(Optional[String], default:None) –The
nextTokenvalue returned from aListContainerInstancesrequest indicating that more results are available to fulfill the request and further calls are needed. IfmaxResultswas provided, it's possible the number of results to be fewer thanmaxResults.This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
-
max_results(Optional[BoxedInteger], default:None) –The maximum number of container instance results that
ListContainerInstancesreturned in paginated output. When this parameter is used,ListContainerInstancesonly returnsmaxResultsresults in a single page along with anextTokenresponse element. The remaining results of the initial request can be seen by sending anotherListContainerInstancesrequest with the returnednextTokenvalue. This value can be between 1 and 100. If this parameter isn't used, thenListContainerInstancesreturns up to 100 results and anextTokenvalue if applicable. -
status(Optional[ContainerInstanceStatus], default:None) –Filters the container instances by status. For example, if you specify the
DRAININGstatus, the results include only container instances that have been set toDRAININGusing UpdateContainerInstancesState. If you don't specify this parameter, the The default is to include container instances set to all states other thanINACTIVE.
Raises:
-
AccessDeniedException–You don't have authorization to perform the requested action.
-
ClientException–These errors are usually caused by a client action. This client action might be using an action or resource on behalf of a user that doesn't have permissions to use the action or resource. Or, it might be specifying an identifier that isn't valid.
-
ClusterNotFoundException–The specified cluster wasn't found. You can view your available clusters with ListClusters. Amazon ECS clusters are Region specific.
-
InvalidParameterException–The specified parameter isn't valid. Review the available parameters for the API request.
For more information about service event errors, see Amazon ECS service event messages.
-
ServerException–These errors are usually caused by a server issue.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To list your available container instances in a cluster This example lists all of your available container instances in the specified cluster in your default region.
Source code in docs_src/capo_ecs/_services/async_ecs.py
2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 | |