cancelServiceInstanceDeployment method
Attempts to cancel a service instance deployment on an
UpdateServiceInstance action, if the deployment is
IN_PROGRESS. For more information, see Update
a service instance in the Proton User guide.
The following list includes potential cancellation scenarios.
-
If the cancellation attempt succeeds, the resulting deployment state is
CANCELLED. -
If the cancellation attempt fails, the resulting deployment state is
FAILED. -
If the current UpdateServiceInstance action succeeds before the
cancellation attempt starts, the resulting deployment state is
SUCCEEDEDand the cancellation attempt has no effect.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter serviceInstanceName :
The name of the service instance with the deployment to cancel.
Parameter serviceName :
The name of the service with the service instance deployment to cancel.
Implementation
Future<CancelServiceInstanceDeploymentOutput>
cancelServiceInstanceDeployment({
required String serviceInstanceName,
required String serviceName,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'AwsProton20200720.CancelServiceInstanceDeployment'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'serviceInstanceName': serviceInstanceName,
'serviceName': serviceName,
},
);
return CancelServiceInstanceDeploymentOutput.fromJson(jsonResponse.body);
}