describeClusters method
- List<
String> ? clusters, - List<
ClusterField> ? include,
Describes one or more of your clusters.
May throw ServerException. May throw ClientException. May throw InvalidParameterException.
Parameter clusters
:
A list of up to 100 cluster names or full cluster Amazon Resource Name
(ARN) entries. If you do not specify a cluster, the default cluster is
assumed.
Parameter include
:
Whether to include additional information about your clusters in the
response. If this field is omitted, the attachments, statistics, and tags
are not included.
If ATTACHMENTS
is specified, the attachments for the
container instances or tasks within the cluster are included.
If SETTINGS
is specified, the settings for the cluster are
included.
If STATISTICS
is specified, the following additional
information, separated by launch type, is included:
- runningEC2TasksCount
- runningFargateTasksCount
- pendingEC2TasksCount
- pendingFargateTasksCount
- activeEC2ServiceCount
- activeFargateServiceCount
- drainingEC2ServiceCount
- drainingFargateServiceCount
TAGS
is specified, the metadata tags associated with the
cluster are included.
Implementation
Future<DescribeClustersResponse> describeClusters({
List<String>? clusters,
List<ClusterField>? include,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AmazonEC2ContainerServiceV20141113.DescribeClusters'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
if (clusters != null) 'clusters': clusters,
if (include != null)
'include': include.map((e) => e.toValue()).toList(),
},
);
return DescribeClustersResponse.fromJson(jsonResponse.body);
}