deleteCapacityProvider method
- required String capacityProvider,
Deletes the specified capacity provider.
Prior to a capacity provider being deleted, the capacity provider must be
removed from the capacity provider strategy from all services. The
UpdateService API can be used to remove a capacity provider from a
service's capacity provider strategy. When updating a service, the
forceNewDeployment
option can be used to ensure that any
tasks using the Amazon EC2 instance capacity provided by the capacity
provider are transitioned to use the capacity from the remaining capacity
providers. Only capacity providers that are not associated with a cluster
can be deleted. To remove a capacity provider from a cluster, you can
either use PutClusterCapacityProviders or delete the cluster.
May throw ServerException. May throw ClientException. May throw InvalidParameterException.
Parameter capacityProvider
:
The short name or full Amazon Resource Name (ARN) of the capacity provider
to delete.
Implementation
Future<DeleteCapacityProviderResponse> deleteCapacityProvider({
required String capacityProvider,
}) async {
ArgumentError.checkNotNull(capacityProvider, 'capacityProvider');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target':
'AmazonEC2ContainerServiceV20141113.DeleteCapacityProvider'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'capacityProvider': capacityProvider,
},
);
return DeleteCapacityProviderResponse.fromJson(jsonResponse.body);
}