Skip to content

pause_service

pause_service(
    service_arn: AppRunnerResourceArn,
    *,
    config_overrides: Optional[AppRunnerClientConfig] = None,
) -> PauseServiceResponse

Pause an active App Runner service. App Runner reduces compute capacity for the service to zero and loses state (for example, ephemeral storage is removed).

This is an asynchronous operation. On a successful call, you can use the returned OperationId and the ListOperations call to track the operation's progress.

Parameters:

  • service_arn (AppRunnerResourceArn) –

    The Amazon Resource Name (ARN) of the App Runner service that you want to pause.

Raises:

Source code in docs_src/capo_apprunner/_services/app_runner.py
def pause_service(
    self,
    service_arn: "capo_apprunner.types.app_runner_resource_arn.AppRunnerResourceArn",
    *,
    config_overrides: Optional[AppRunnerClientConfig] = None,
) -> "capo_apprunner.types.pause_service_response.PauseServiceResponse":
    """<p>Pause an active App Runner service. App Runner reduces compute capacity for the service to zero and loses state (for example, ephemeral storage is removed).</p> <p>This is an asynchronous operation. On a successful call, you can use the returned <code>OperationId</code> and the <a>ListOperations</a> call to track the operation's progress.</p>

    Args:
        service_arn: <p>The Amazon Resource Name (ARN) of the App Runner service that you want to pause.</p>

    Raises:
        capo_apprunner.errors.internal_service_error_exception.InternalServiceErrorException: <p>An unexpected service exception occurred.</p>
        capo_apprunner.errors.invalid_request_exception.InvalidRequestException: <p>One or more input parameters aren't valid. Refer to the API action's document page, correct the input parameters, and try the action again.</p>
        capo_apprunner.errors.invalid_state_exception.InvalidStateException: <p>You can't perform this action when the resource is in its current state.</p>
        capo_apprunner.errors.resource_not_found_exception.ResourceNotFoundException: <p>A resource doesn't exist for the specified Amazon Resource Name (ARN) in your Amazon Web Services account.</p>
        capo_apprunner.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_apprunner.types.pause_service_request.PauseServiceRequest]",
    ) -> OperationResponse[
        "capo_apprunner.types.pause_service_response.PauseServiceResponse"
    ]:
        import capo_apprunner._operations.app_runner.pause_service

        output, http_response = (
            capo_apprunner._operations.app_runner.pause_service.pause_service(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_apprunner.types.pause_service_response.PauseServiceResponse",
    ) -> dict[str, Any]:
        import capo_apprunner.types.pause_service_response

        return capo_apprunner.types.pause_service_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("PauseService", redact_output=_redact_output),
    )
    input_: capo_apprunner.types.pause_service_request.PauseServiceRequest = {
        "service_arn": service_arn
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output