Skip to content

stop_application

stop_application(
    application_id: Identifier,
    *,
    config_overrides: Optional[m2ClientConfig] = None,
    force_stop: Optional[Boolean] = None,
) -> StopApplicationResponse

Stops a running application.

Parameters:

  • application_id (Identifier) –

    The unique identifier of the application you want to stop.

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

    Stopping an application process can take a long time. Setting this parameter to true lets you force stop the application so you don't need to wait until the process finishes to apply another action on the application. The default value is false.

Raises:

Source code in docs_src/capo_m2/_services/m2.py
def stop_application(
    self,
    application_id: "capo_m2.types.identifier.Identifier",
    *,
    config_overrides: Optional[m2ClientConfig] = None,
    force_stop: Optional["capo_m2.types.boolean.Boolean"] = None,
) -> "capo_m2.types.stop_application_response.StopApplicationResponse":
    """<p>Stops a running application.</p>

    Args:
        application_id: <p>The unique identifier of the application you want to stop.</p>
        force_stop: <p>Stopping an application process can take a long time. Setting this parameter to true lets you force stop the application so you don't need to wait until the process finishes to apply another action on the application. The default value is false.</p>

    Raises:
        capo_m2.errors.access_denied_exception.AccessDeniedException: <p>The account or role doesn't have the right permissions to make the request.</p>
        capo_m2.errors.conflict_exception.ConflictException: <p>The parameters provided in the request conflict with existing resources.</p>
        capo_m2.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred during the processing of the request.</p>
        capo_m2.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_m2.errors.throttling_exception.ThrottlingException: <p>The number of requests made exceeds the limit.</p>
        capo_m2.errors.validation_exception.ValidationException: <p>One or more parameters provided in the request is not valid.</p>
        capo_m2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        output, http_response = (
            capo_m2._operations.aws_supernova_control_plane_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_m2.types.stop_application_request.StopApplicationRequest = {
        "application_id": application_id
    }
    if force_stop is not None:
        input_["force_stop"] = force_stop

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