updateApplication method

Future<UpdateApplicationResponse> updateApplication({
  1. required String applicationName,
  2. ApplicationConfigurationUpdate? applicationConfigurationUpdate,
  3. List<CloudWatchLoggingOptionUpdate>? cloudWatchLoggingOptionUpdates,
  4. String? conditionalToken,
  5. int? currentApplicationVersionId,
  6. RunConfigurationUpdate? runConfigurationUpdate,
  7. RuntimeEnvironment? runtimeEnvironmentUpdate,
  8. String? serviceExecutionRoleUpdate,
})

Updates an existing Managed Service for Apache Flink application. Using this operation, you can update application code, input configuration, and output configuration.

Managed Service for Apache Flink updates the ApplicationVersionId each time you update your application.

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

Parameter applicationName : The name of the application to update.

Parameter applicationConfigurationUpdate : Describes application configuration updates.

Parameter cloudWatchLoggingOptionUpdates : Describes application Amazon CloudWatch logging option updates. You can only update existing CloudWatch logging options with this action. To add a new CloudWatch logging option, use AddApplicationCloudWatchLoggingOption.

Parameter conditionalToken : A value you use to implement strong concurrency for application updates. You must provide the CurrentApplicationVersionId or the ConditionalToken. You get the application's current ConditionalToken using DescribeApplication. For better concurrency support, use the ConditionalToken parameter instead of CurrentApplicationVersionId.

Parameter currentApplicationVersionId : The current application version ID. You must provide the CurrentApplicationVersionId or the ConditionalToken.You can retrieve the application version ID using DescribeApplication. For better concurrency support, use the ConditionalToken parameter instead of CurrentApplicationVersionId.

Parameter runConfigurationUpdate : Describes updates to the application's starting parameters.

Parameter runtimeEnvironmentUpdate : Updates the Managed Service for Apache Flink runtime environment used to run your code. To avoid issues you must:

  • Ensure your new jar and dependencies are compatible with the new runtime selected.
  • Ensure your new code's state is compatible with the snapshot from which your application will start

Parameter serviceExecutionRoleUpdate : Describes updates to the service execution role.

Implementation

Future<UpdateApplicationResponse> updateApplication({
  required String applicationName,
  ApplicationConfigurationUpdate? applicationConfigurationUpdate,
  List<CloudWatchLoggingOptionUpdate>? cloudWatchLoggingOptionUpdates,
  String? conditionalToken,
  int? currentApplicationVersionId,
  RunConfigurationUpdate? runConfigurationUpdate,
  RuntimeEnvironment? runtimeEnvironmentUpdate,
  String? serviceExecutionRoleUpdate,
}) async {
  _s.validateNumRange(
    'currentApplicationVersionId',
    currentApplicationVersionId,
    1,
    999999999,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'KinesisAnalytics_20180523.UpdateApplication'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ApplicationName': applicationName,
      if (applicationConfigurationUpdate != null)
        'ApplicationConfigurationUpdate': applicationConfigurationUpdate,
      if (cloudWatchLoggingOptionUpdates != null)
        'CloudWatchLoggingOptionUpdates': cloudWatchLoggingOptionUpdates,
      if (conditionalToken != null) 'ConditionalToken': conditionalToken,
      if (currentApplicationVersionId != null)
        'CurrentApplicationVersionId': currentApplicationVersionId,
      if (runConfigurationUpdate != null)
        'RunConfigurationUpdate': runConfigurationUpdate,
      if (runtimeEnvironmentUpdate != null)
        'RuntimeEnvironmentUpdate': runtimeEnvironmentUpdate.value,
      if (serviceExecutionRoleUpdate != null)
        'ServiceExecutionRoleUpdate': serviceExecutionRoleUpdate,
    },
  );

  return UpdateApplicationResponse.fromJson(jsonResponse.body);
}