continueServiceDeployment method
Continues or rolls back an Amazon ECS service deployment that is paused at a lifecycle hook.
When a service deployment reaches a lifecycle stage that has a
PAUSE hook configured, the deployment pauses and waits for an
explicit action. Use this API to either continue the deployment to the
next stage or roll back to the previous service revision.
To find the hookId of the paused hook, call DescribeServiceDeployments
and inspect the lifecycleHookDetails field.
May throw AccessDeniedException.
May throw ClientException.
May throw InvalidParameterException.
May throw ServerException.
May throw ServiceDeploymentNotFoundException.
May throw UnsupportedFeatureException.
Parameter hookId :
The ID of the paused lifecycle hook to act on. You can find the
hookId by calling DescribeServiceDeployments
and inspecting the lifecycleHookDetails field of the service
deployment.
Parameter serviceDeploymentArn :
The ARN of the service deployment to continue or roll back.
Parameter action :
The action to take on the paused lifecycle hook. Valid values are:
-
CONTINUE- Proceeds the deployment to the next lifecycle stage. -
ROLLBACK- Rolls back the deployment to the previous service revision.
CONTINUE.
Implementation
Future<ContinueServiceDeploymentResponse> continueServiceDeployment({
required String hookId,
required String serviceDeploymentArn,
DeploymentLifecycleHookAction? action,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target':
'AmazonEC2ContainerServiceV20141113.ContinueServiceDeployment'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'hookId': hookId,
'serviceDeploymentArn': serviceDeploymentArn,
if (action != null) 'action': action.value,
},
);
return ContinueServiceDeploymentResponse.fromJson(jsonResponse.body);
}