putLifecycleEventHookExecutionStatus method
Sets the result of a Lambda validation function. The function validates
lifecycle hooks during a deployment that uses the Lambda or Amazon ECS
compute platform. For Lambda deployments, the available lifecycle hooks
are BeforeAllowTraffic and AfterAllowTraffic.
For Amazon ECS deployments, the available lifecycle hooks are
BeforeInstall, AfterInstall,
AfterAllowTestTraffic, BeforeAllowTraffic, and
AfterAllowTraffic. Lambda validation functions return
Succeeded or Failed. For more information, see
AppSpec
'hooks' Section for an Lambda Deployment and AppSpec
'hooks' Section for an Amazon ECS Deployment.
May throw DeploymentDoesNotExistException.
May throw DeploymentIdRequiredException.
May throw InvalidDeploymentIdException.
May throw InvalidLifecycleEventHookExecutionIdException.
May throw InvalidLifecycleEventHookExecutionStatusException.
May throw LifecycleEventAlreadyCompletedException.
May throw UnsupportedActionForDeploymentTypeException.
Parameter deploymentId :
The unique ID of a deployment. Pass this ID to a Lambda function that
validates a deployment lifecycle event.
Parameter lifecycleEventHookExecutionId :
The execution ID of a deployment's lifecycle hook. A deployment lifecycle
hook is specified in the hooks section of the AppSpec file.
Parameter status :
The result of a Lambda function that validates a deployment lifecycle
event. The values listed in Valid Values are valid for lifecycle
statuses in general; however, only Succeeded and
Failed can be passed successfully in your API call.
Implementation
Future<PutLifecycleEventHookExecutionStatusOutput>
putLifecycleEventHookExecutionStatus({
String? deploymentId,
String? lifecycleEventHookExecutionId,
LifecycleEventStatus? status,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'CodeDeploy_20141006.PutLifecycleEventHookExecutionStatus'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
if (deploymentId != null) 'deploymentId': deploymentId,
if (lifecycleEventHookExecutionId != null)
'lifecycleEventHookExecutionId': lifecycleEventHookExecutionId,
if (status != null) 'status': status.value,
},
);
return PutLifecycleEventHookExecutionStatusOutput.fromJson(
jsonResponse.body);
}