Attempts to stop an ongoing deployment.
Parameters:
-
deployment_id
(DeploymentId)
–
The unique ID of a deployment.
-
auto_rollback_enabled
(Optional[NullableBoolean], default:
None
)
–
Indicates, when a deployment is stopped, whether instances that have been updated should be rolled back to the previous version of the application revision.
Raises:
Source code in docs_src/capo_codedeploy/_services/code_deploy.py
| def stop_deployment(
self,
deployment_id: "capo_codedeploy.types.deployment_id.DeploymentId",
*,
config_overrides: Optional[CodeDeployClientConfig] = None,
auto_rollback_enabled: Optional[
"capo_codedeploy.types.nullable_boolean.NullableBoolean"
] = None,
) -> "capo_codedeploy.types.stop_deployment_output.StopDeploymentOutput":
"""<p>Attempts to stop an ongoing deployment.</p>
Args:
deployment_id: <p> The unique ID of a deployment. </p>
auto_rollback_enabled: <p> Indicates, when a deployment is stopped, whether instances that have been updated should be rolled back to the previous version of the application revision. </p>
Raises:
capo_codedeploy.errors.deployment_already_completed_exception.DeploymentAlreadyCompletedException: <p>The deployment is already complete.</p>
capo_codedeploy.errors.deployment_does_not_exist_exception.DeploymentDoesNotExistException: <p>The deployment with the user or Amazon Web Services account does not exist.</p>
capo_codedeploy.errors.deployment_group_does_not_exist_exception.DeploymentGroupDoesNotExistException: <p>The named deployment group with the user or Amazon Web Services account does not exist.</p>
capo_codedeploy.errors.deployment_id_required_exception.DeploymentIdRequiredException: <p>At least one deployment ID must be specified.</p>
capo_codedeploy.errors.invalid_deployment_id_exception.InvalidDeploymentIdException: <p>At least one of the deployment IDs was specified in an invalid format.</p>
capo_codedeploy.errors.unsupported_action_for_deployment_type_exception.UnsupportedActionForDeploymentTypeException: <p>A call was submitted that is not supported for the specified deployment type.</p>
capo_codedeploy.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_codedeploy.types.stop_deployment_input.StopDeploymentInput]",
) -> OperationResponse[
"capo_codedeploy.types.stop_deployment_output.StopDeploymentOutput"
]:
import capo_codedeploy._operations.code_deploy_20141006.stop_deployment
output, http_response = (
capo_codedeploy._operations.code_deploy_20141006.stop_deployment.stop_deployment(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("StopDeployment")
)
input_: capo_codedeploy.types.stop_deployment_input.StopDeploymentInput = {
"deployment_id": deployment_id
}
if auto_rollback_enabled is not None:
input_["auto_rollback_enabled"] = auto_rollback_enabled
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|