Skip to content

stop_deployment async

stop_deployment(
    application_id: Name,
    environment_id: Name,
    deployment_number: Integer,
    *,
    config_overrides: Optional[AsyncAppConfigClientConfig] = None,
    allow_revert: Optional[Boolean] = None,
) -> Deployment

Stops a deployment. This API action works only on deployments that have a status of DEPLOYING, unless an AllowRevert parameter is supplied. If the AllowRevert parameter is supplied, the status of an in-progress deployment will be ROLLED_BACK. The status of a completed deployment will be REVERTED. AppConfig only allows a revert within 72 hours of deployment completion.

Parameters:

  • application_id (Name) –

    The application ID.

  • environment_id (Name) –

    The environment ID.

  • deployment_number (Integer) –

    The sequence number of the deployment.

  • allow_revert (Optional[Boolean], default: None ) –

    A Boolean that enables AppConfig to rollback a COMPLETED deployment to the previous configuration version. This action moves the deployment to a status of REVERTED.

Raises:

Examples:

To stop configuration deployment The following stop-deployment example stops the deployment of an application configuration to the specified environment.

>>> await client.stop_deployment(application_id='339ohji', environment_id='54j1r29', deployment_number=2)
Source code in docs_src/capo_appconfig/_services/async_app_config.py
async def stop_deployment(
    self,
    application_id: "capo_appconfig.types.name.Name",
    environment_id: "capo_appconfig.types.name.Name",
    deployment_number: "capo_appconfig.types.integer.Integer",
    *,
    config_overrides: Optional[AsyncAppConfigClientConfig] = None,
    allow_revert: Optional["capo_appconfig.types.boolean.Boolean"] = None,
) -> "capo_appconfig.types.deployment.Deployment":
    """<p>Stops a deployment. This API action works only on deployments that have a status of <code>DEPLOYING</code>, unless an <code>AllowRevert</code> parameter is supplied. If the <code>AllowRevert</code> parameter is supplied, the status of an in-progress deployment will be <code>ROLLED_BACK</code>. The status of a completed deployment will be <code>REVERTED</code>. AppConfig only allows a revert within 72 hours of deployment completion.</p>

    Args:
        application_id: <p>The application ID.</p>
        environment_id: <p>The environment ID.</p>
        deployment_number: <p>The sequence number of the deployment.</p>
        allow_revert: <p>A Boolean that enables AppConfig to rollback a <code>COMPLETED</code> deployment to the previous configuration version. This action moves the deployment to a status of <code>REVERTED</code>.</p>

    Raises:
        capo_appconfig.errors.bad_request_exception.BadRequestException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_appconfig.errors.internal_server_exception.InternalServerException: <p>There was an internal failure in the AppConfig service.</p>
        capo_appconfig.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource could not be found.</p>
        capo_appconfig.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To stop configuration deployment
        The following stop-deployment example stops the deployment of an application configuration to the specified environment.

        >>> await client.stop_deployment(application_id='339ohji', environment_id='54j1r29', deployment_number=2)
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_appconfig.types.stop_deployment_request.StopDeploymentRequest]",
    ) -> AsyncOperationResponse["capo_appconfig.types.deployment.Deployment"]:
        import capo_appconfig._operations.amazon_app_config.stop_deployment

        (
            output,
            http_response,
        ) = await capo_appconfig._operations.amazon_app_config.stop_deployment.async_stop_deployment(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StopDeployment")
    )
    input_: capo_appconfig.types.stop_deployment_request.StopDeploymentRequest = {
        "application_id": application_id,
        "environment_id": environment_id,
        "deployment_number": deployment_number,
    }
    if allow_revert is not None:
        input_["allow_revert"] = allow_revert

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output