Skip to content

stop_application

stop_application(
    application_name: ApplicationName,
    *,
    config_overrides: Optional[KinesisAnalyticsClientConfig] = None,
) -> StopApplicationResponse

This documentation is for version 1 of the Amazon Kinesis Data Analytics API, which only supports SQL applications. Version 2 of the API supports SQL and Java applications. For more information about version 2, see Amazon Kinesis Data Analytics API V2 Documentation.

Stops the application from processing input data. You can stop an application only if it is in the running state. You can use the DescribeApplication operation to find the application state. After the application is stopped, Amazon Kinesis Analytics stops reading data from the input, the application stops processing data, and there is no output written to the destination.

This operation requires permissions to perform the kinesisanalytics:StopApplication action.

Parameters:

  • application_name (ApplicationName) –

    Name of the running application to stop.

Raises:

Source code in docs_src/capo_kinesis_analytics/_services/kinesis_analytics.py
def stop_application(
    self,
    application_name: "capo_kinesis_analytics.types.application_name.ApplicationName",
    *,
    config_overrides: Optional[KinesisAnalyticsClientConfig] = None,
) -> (
    "capo_kinesis_analytics.types.stop_application_response.StopApplicationResponse"
):
    """<note> <p>This documentation is for version 1 of the Amazon Kinesis Data Analytics API, which only supports SQL applications. Version 2 of the API supports SQL and Java applications. For more information about version 2, see <a href="/kinesisanalytics/latest/apiv2/Welcome.html">Amazon Kinesis Data Analytics API V2 Documentation</a>.</p> </note> <p>Stops the application from processing input data. You can stop an application only if it is in the running state. You can use the <a href="https://docs.aws.amazon.com/kinesisanalytics/latest/dev/API_DescribeApplication.html">DescribeApplication</a> operation to find the application state. After the application is stopped, Amazon Kinesis Analytics stops reading data from the input, the application stops processing data, and there is no output written to the destination. </p> <p>This operation requires permissions to perform the <code>kinesisanalytics:StopApplication</code> action.</p>

    Args:
        application_name: <p>Name of the running application to stop.</p>

    Raises:
        capo_kinesis_analytics.errors.resource_in_use_exception.ResourceInUseException: <p>Application is not available for this operation.</p>
        capo_kinesis_analytics.errors.resource_not_found_exception.ResourceNotFoundException: <p>Specified application can't be found.</p>
        capo_kinesis_analytics.errors.unsupported_operation_exception.UnsupportedOperationException: <p>The request was rejected because a specified parameter is not supported or a specified resource is not valid for this operation. </p>
        capo_kinesis_analytics.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        output, http_response = (
            capo_kinesis_analytics._operations.kinesis_analytics_20150814.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_kinesis_analytics.types.stop_application_request.StopApplicationRequest = {
        "application_name": application_name
    }

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