describeContainerInstances method

Future<DescribeContainerInstancesResponse> describeContainerInstances({
  1. required List<String> containerInstances,
  2. String? cluster,
  3. List<ContainerInstanceField>? include,
})

Describes Amazon Elastic Container Service container instances. Returns metadata about registered and remaining resources on each container instance requested.

May throw ServerException. May throw ClientException. May throw InvalidParameterException. May throw ClusterNotFoundException.

Parameter containerInstances : A list of up to 100 container instance IDs or full Amazon Resource Name (ARN) entries.

Parameter cluster : The short name or full Amazon Resource Name (ARN) of the cluster that hosts the container instances to describe. If you do not specify a cluster, the default cluster is assumed. This parameter is required if the container instance or container instances you are describing were launched in any cluster other than the default cluster.

Parameter include : Specifies whether you want to see the resource tags for the container instance. If TAGS is specified, the tags are included in the response. If this field is omitted, tags are not included in the response.

Implementation

Future<DescribeContainerInstancesResponse> describeContainerInstances({
  required List<String> containerInstances,
  String? cluster,
  List<ContainerInstanceField>? include,
}) async {
  ArgumentError.checkNotNull(containerInstances, 'containerInstances');
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'AmazonEC2ContainerServiceV20141113.DescribeContainerInstances'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'containerInstances': containerInstances,
      if (cluster != null) 'cluster': cluster,
      if (include != null)
        'include': include.map((e) => e.toValue()).toList(),
    },
  );

  return DescribeContainerInstancesResponse.fromJson(jsonResponse.body);
}