stopApplication method

Future<StopApplicationResponse> stopApplication({
  1. required String applicationName,
  2. bool? force,
})

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.

May throw ConcurrentModificationException. May throw InvalidApplicationConfigurationException. May throw InvalidArgumentException. May throw InvalidRequestException. May throw ResourceInUseException. May throw ResourceNotFoundException.

Parameter applicationName : The name of the running application to stop.

Parameter force : 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. 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.

Implementation

Future<StopApplicationResponse> stopApplication({
  required String applicationName,
  bool? force,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'KinesisAnalytics_20180523.StopApplication'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ApplicationName': applicationName,
      if (force != null) 'Force': force,
    },
  );

  return StopApplicationResponse.fromJson(jsonResponse.body);
}