describeCapacityProviders method
Describes one or more of your capacity providers.
May throw AccessDeniedException.
May throw ClientException.
May throw ClusterNotFoundException.
May throw InvalidParameterException.
May throw ServerException.
May throw UnsupportedFeatureException.
Parameter capacityProviders :
The short name or full Amazon Resource Name (ARN) of one or more capacity
providers. Up to 100 capacity providers can be described in
an action.
Parameter cluster :
The name of the cluster to describe capacity providers for. When
specified, only capacity providers associated with this cluster are
returned, including Amazon ECS Managed Instances capacity providers.
Parameter include :
Specifies whether or not you want to see the resource tags for the
capacity provider. If TAGS is specified, the tags are
included in the response. If this field is omitted, tags aren't included
in the response.
Parameter maxResults :
The maximum number of account setting results returned by
DescribeCapacityProviders in paginated output. When this
parameter is used, DescribeCapacityProviders only returns
maxResults results in a single page along with a
nextToken response element. The remaining results of the
initial request can be seen by sending another
DescribeCapacityProviders request with the returned
nextToken value. This value can be between 1 and 10. If this
parameter is not used, then DescribeCapacityProviders returns
up to 10 results and a nextToken value if applicable.
Parameter nextToken :
The nextToken value returned from a previous paginated
DescribeCapacityProviders request where
maxResults was used and the results exceeded the value of
that parameter. Pagination continues from the end of the previous results
that returned the nextToken value.
Implementation
Future<DescribeCapacityProvidersResponse> describeCapacityProviders({
List<String>? capacityProviders,
String? cluster,
List<CapacityProviderField>? include,
int? maxResults,
String? nextToken,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target':
'AmazonEC2ContainerServiceV20141113.DescribeCapacityProviders'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
if (capacityProviders != null) 'capacityProviders': capacityProviders,
if (cluster != null) 'cluster': cluster,
if (include != null) 'include': include.map((e) => e.value).toList(),
if (maxResults != null) 'maxResults': maxResults,
if (nextToken != null) 'nextToken': nextToken,
},
);
return DescribeCapacityProvidersResponse.fromJson(jsonResponse.body);
}