Skip to content

stop_application

stop_application(
    application_id: ApplicationId,
    *,
    config_overrides: Optional[EMRServerlessClientConfig] = None,
) -> StopApplicationResponse

Stops a specified application and releases initial capacity if configured. All scheduled and running jobs must be completed or cancelled before stopping an application.

Parameters:

  • application_id (ApplicationId) –

    The ID of the application to stop.

Raises:

Source code in docs_src/capo_emr_serverless/_services/emr_serverless.py
def stop_application(
    self,
    application_id: "capo_emr_serverless.types.application_id.ApplicationId",
    *,
    config_overrides: Optional[EMRServerlessClientConfig] = None,
) -> "capo_emr_serverless.types.stop_application_response.StopApplicationResponse":
    """<p>Stops a specified application and releases initial capacity if configured. All scheduled and running jobs must be completed or cancelled before stopping an application.</p>

    Args:
        application_id: <p>The ID of the application to stop.</p>

    Raises:
        capo_emr_serverless.errors.internal_server_exception.InternalServerException: <p>Request processing failed because of an error or failure with the service.</p>
        capo_emr_serverless.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_emr_serverless.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_emr_serverless.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_emr_serverless.types.stop_application_request.StopApplicationRequest]",
    ) -> OperationResponse[
        "capo_emr_serverless.types.stop_application_response.StopApplicationResponse"
    ]:
        import capo_emr_serverless._operations.aws_toledo_web_service.stop_application

        output, http_response = (
            capo_emr_serverless._operations.aws_toledo_web_service.stop_application.stop_application(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StopApplication")
    )
    input_: capo_emr_serverless.types.stop_application_request.StopApplicationRequest = {
        "application_id": application_id
    }

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