Skip to content

stop_automation_execution async

stop_automation_execution(
    automation_execution_id: AutomationExecutionId,
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    type: Optional[StopType] = None,
) -> StopAutomationExecutionResult

Stop an Automation that is currently running.

Parameters:

  • automation_execution_id (AutomationExecutionId) –

    The execution ID of the Automation to stop.

  • type (Optional[StopType], default: None ) –

    The stop request type. Valid types include the following: Cancel and Complete. The default type is Cancel.

Raises:

Source code in docs_src/capo_ssm/_services/async_ssm.py
async def stop_automation_execution(
    self,
    automation_execution_id: "capo_ssm.types.automation_execution_id.AutomationExecutionId",
    *,
    config_overrides: Optional[AsyncSSMClientConfig] = None,
    type: Optional["capo_ssm.types.stop_type.StopType"] = None,
) -> (
    "capo_ssm.types.stop_automation_execution_result.StopAutomationExecutionResult"
):
    """<p>Stop an Automation that is currently running.</p>

    Args:
        automation_execution_id: <p>The execution ID of the Automation to stop.</p>
        type: <p>The stop request type. Valid types include the following: Cancel and Complete. The default type is Cancel.</p>

    Raises:
        capo_ssm.errors.automation_execution_not_found_exception.AutomationExecutionNotFoundException: <p>There is no automation execution information for the requested automation execution ID.</p>
        capo_ssm.errors.internal_server_error.InternalServerError: <p>An error occurred on the server side.</p>
        capo_ssm.errors.invalid_automation_status_update_exception.InvalidAutomationStatusUpdateException: <p>The specified update status operation isn't valid.</p>
        capo_ssm.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_ssm.types.stop_automation_execution_request.StopAutomationExecutionRequest]",
    ) -> AsyncOperationResponse[
        "capo_ssm.types.stop_automation_execution_result.StopAutomationExecutionResult"
    ]:
        import capo_ssm._operations.amazon_ssm.stop_automation_execution

        (
            output,
            http_response,
        ) = await capo_ssm._operations.amazon_ssm.stop_automation_execution.async_stop_automation_execution(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StopAutomationExecution")
    )
    input_: capo_ssm.types.stop_automation_execution_request.StopAutomationExecutionRequest = {
        "automation_execution_id": automation_execution_id
    }
    if type is not None:
        input_["type"] = type

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