stopApplication method
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.
Kinesis Data Analytics takes a snapshot when the application is stopped,
unless Force
is set to true
.
May throw ResourceNotFoundException. May throw ResourceInUseException. May throw InvalidArgumentException. May throw InvalidRequestException. May throw InvalidApplicationConfigurationException. May throw ConcurrentModificationException.
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
, Kinesis Data Analytics stops the
application without taking a snapshot.
You can only force stop a Flink-based Kinesis Data Analytics 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<void> stopApplication({
required String applicationName,
bool? force,
}) async {
ArgumentError.checkNotNull(applicationName, 'applicationName');
_s.validateStringLength(
'applicationName',
applicationName,
1,
128,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'KinesisAnalytics_20180523.StopApplication'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ApplicationName': applicationName,
if (force != null) 'Force': force,
},
);
}