rollbackApplication method
Reverts the application to the previous running version. You can roll back an application if you suspect it is stuck in a transient status or in the running status.
You can roll back an application only if it is in the
UPDATING, AUTOSCALING, or RUNNING
statuses.
When you rollback an application, it loads state data from the last successful snapshot. If the application has no snapshots, Managed Service for Apache Flink rejects the rollback request.
May throw ConcurrentModificationException.
May throw InvalidArgumentException.
May throw InvalidRequestException.
May throw ResourceInUseException.
May throw ResourceNotFoundException.
May throw UnsupportedOperationException.
Parameter applicationName :
The name of the application.
Parameter currentApplicationVersionId :
The current application version ID. You can retrieve the application
version ID using DescribeApplication.
Implementation
Future<RollbackApplicationResponse> rollbackApplication({
required String applicationName,
required int currentApplicationVersionId,
}) async {
_s.validateNumRange(
'currentApplicationVersionId',
currentApplicationVersionId,
1,
999999999,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'KinesisAnalytics_20180523.RollbackApplication'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ApplicationName': applicationName,
'CurrentApplicationVersionId': currentApplicationVersionId,
},
);
return RollbackApplicationResponse.fromJson(jsonResponse.body);
}