Stops the application from processing data. You can stop an application only if it is in the running status, unless you set the Force parameter to true.
You can use the DescribeApplication operation to find the application status.
Managed Service for Apache Flink takes a snapshot when the application is stopped, unless Force is set to true.
Parameters:
-
application_name
(ApplicationName)
–
The name of the running application to stop.
-
force
(Optional[BooleanObject], default:
None
)
–
Set to true to force the application to stop. If you set Force to true, Managed Service for Apache Flink stops the application without taking a snapshot.
Force-stopping your application may lead to data loss or duplication. To prevent data loss or duplicate processing of data during application restarts, we recommend you to take frequent snapshots of your application.
You can only force stop a Managed Service for Apache Flink application. You can't force stop a SQL-based Kinesis Data Analytics application.
The application must be in the STARTING, UPDATING, STOPPING, AUTOSCALING, or RUNNING status.
Raises:
Source code in docs_src/capo_kinesis_analytics_v2/_services/kinesis_analytics_v2.py
| def stop_application(
self,
application_name: "capo_kinesis_analytics_v2.types.application_name.ApplicationName",
*,
config_overrides: Optional[KinesisAnalyticsV2ClientConfig] = None,
force: Optional[
"capo_kinesis_analytics_v2.types.boolean_object.BooleanObject"
] = None,
) -> "capo_kinesis_analytics_v2.types.stop_application_response.StopApplicationResponse":
"""<p>Stops the application from processing data. You can stop an application only if it is in the running status, unless you set the <code>Force</code> parameter to <code>true</code>.</p> <p>You can use the <a>DescribeApplication</a> operation to find the application status. </p> <p>Managed Service for Apache Flink takes a snapshot when the application is stopped, unless <code>Force</code> is set to <code>true</code>.</p>
Args:
application_name: <p>The name of the running application to stop.</p>
force: <p>Set to <code>true</code> to force the application to stop. If you set <code>Force</code> to <code>true</code>, Managed Service for Apache Flink stops the application without taking a snapshot. </p> <note> <p>Force-stopping your application may lead to data loss or duplication. To prevent data loss or duplicate processing of data during application restarts, we recommend you to take frequent snapshots of your application.</p> </note> <p>You can only force stop a Managed Service for Apache Flink application. You can't force stop a SQL-based Kinesis Data Analytics application.</p> <p>The application must be in the <code>STARTING</code>, <code>UPDATING</code>, <code>STOPPING</code>, <code>AUTOSCALING</code>, or <code>RUNNING</code> status. </p>
Raises:
capo_kinesis_analytics_v2.errors.concurrent_modification_exception.ConcurrentModificationException: <p>Exception thrown as a result of concurrent modifications to an application. This error can be the result of attempting to modify an application without using the current application ID.</p>
capo_kinesis_analytics_v2.errors.invalid_application_configuration_exception.InvalidApplicationConfigurationException: <p>The user-provided application configuration is not valid.</p>
capo_kinesis_analytics_v2.errors.invalid_argument_exception.InvalidArgumentException: <p>The specified input parameter value is not valid.</p>
capo_kinesis_analytics_v2.errors.invalid_request_exception.InvalidRequestException: <p>The request JSON is not valid for the operation.</p>
capo_kinesis_analytics_v2.errors.resource_in_use_exception.ResourceInUseException: <p>The application is not available for this operation.</p>
capo_kinesis_analytics_v2.errors.resource_not_found_exception.ResourceNotFoundException: <p>Specified application can't be found.</p>
capo_kinesis_analytics_v2.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_kinesis_analytics_v2.types.stop_application_request.StopApplicationRequest]",
) -> OperationResponse[
"capo_kinesis_analytics_v2.types.stop_application_response.StopApplicationResponse"
]:
import capo_kinesis_analytics_v2._operations.kinesis_analytics_20180523.stop_application
output, http_response = (
capo_kinesis_analytics_v2._operations.kinesis_analytics_20180523.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_v2.types.stop_application_request.StopApplicationRequest = {
"application_name": application_name
}
if force is not None:
input_["force"] = force
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|