updateApplication method

Future<UpdateApplicationResponse> updateApplication({
  1. required String applicationId,
  2. Architecture? architecture,
  3. AutoStartConfig? autoStartConfiguration,
  4. AutoStopConfig? autoStopConfiguration,
  5. String? clientToken,
  6. DiskEncryptionConfiguration? diskEncryptionConfiguration,
  7. IdentityCenterConfigurationInput? identityCenterConfiguration,
  8. ImageConfigurationInput? imageConfiguration,
  9. Map<String, InitialCapacityConfig>? initialCapacity,
  10. InteractiveConfiguration? interactiveConfiguration,
  11. JobLevelCostAllocationConfiguration? jobLevelCostAllocationConfiguration,
  12. MaximumAllowedResources? maximumCapacity,
  13. MonitoringConfiguration? monitoringConfiguration,
  14. NetworkConfiguration? networkConfiguration,
  15. String? releaseLabel,
  16. List<Configuration>? runtimeConfiguration,
  17. SchedulerConfiguration? schedulerConfiguration,
  18. Map<String, WorkerTypeSpecificationInput>? workerTypeSpecifications,
})

Updates a specified application. An application has to be in a stopped or created state in order to be updated.

May throw InternalServerException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter applicationId : The ID of the application to update.

Parameter architecture : The CPU architecture of an application.

Parameter autoStartConfiguration : The configuration for an application to automatically start on job submission.

Parameter autoStopConfiguration : The configuration for an application to automatically stop after a certain amount of time being idle.

Parameter clientToken : The client idempotency token of the application to update. Its value must be unique for each request.

Parameter diskEncryptionConfiguration : The configuration object that allows encrypting local disks.

Parameter identityCenterConfiguration : Specifies the IAM Identity Center configuration used to enable or disable trusted identity propagation. When provided, this configuration determines how the application interacts with IAM Identity Center for user authentication and access control.

Parameter imageConfiguration : The image configuration to be used for all worker types. You can either set this parameter or imageConfiguration for each worker type in WorkerTypeSpecificationInput.

Parameter initialCapacity : The capacity to initialize when the application is updated.

Parameter interactiveConfiguration : The interactive configuration object that contains new interactive use cases when the application is updated.

Parameter jobLevelCostAllocationConfiguration : The configuration object that enables job level cost allocation.

Parameter maximumCapacity : The maximum capacity to allocate when the application is updated. This is cumulative across all workers at any given point in time during the lifespan of the application. No new resources will be created once any one of the defined limits is hit.

Parameter monitoringConfiguration : The configuration setting for monitoring.

Parameter releaseLabel : The Amazon EMR release label for the application. You can change the release label to use a different release of Amazon EMR.

Parameter runtimeConfiguration : The Configuration specifications to use when updating an application. Each configuration consists of a classification and properties. This configuration is applied across all the job runs submitted under the application.

Parameter schedulerConfiguration : The scheduler configuration for batch and streaming jobs running on this application. Supported with release labels emr-7.0.0 and above.

Parameter workerTypeSpecifications : The key-value pairs that specify worker type to WorkerTypeSpecificationInput. This parameter must contain all valid worker types for a Spark or Hive application. Valid worker types include Driver and Executor for Spark applications and HiveDriver and TezTask for Hive applications. You can either set image details in this parameter for each worker type, or in imageConfiguration for all worker types.

Implementation

Future<UpdateApplicationResponse> updateApplication({
  required String applicationId,
  Architecture? architecture,
  AutoStartConfig? autoStartConfiguration,
  AutoStopConfig? autoStopConfiguration,
  String? clientToken,
  DiskEncryptionConfiguration? diskEncryptionConfiguration,
  IdentityCenterConfigurationInput? identityCenterConfiguration,
  ImageConfigurationInput? imageConfiguration,
  Map<String, InitialCapacityConfig>? initialCapacity,
  InteractiveConfiguration? interactiveConfiguration,
  JobLevelCostAllocationConfiguration? jobLevelCostAllocationConfiguration,
  MaximumAllowedResources? maximumCapacity,
  MonitoringConfiguration? monitoringConfiguration,
  NetworkConfiguration? networkConfiguration,
  String? releaseLabel,
  List<Configuration>? runtimeConfiguration,
  SchedulerConfiguration? schedulerConfiguration,
  Map<String, WorkerTypeSpecificationInput>? workerTypeSpecifications,
}) async {
  final $payload = <String, dynamic>{
    if (architecture != null) 'architecture': architecture.value,
    if (autoStartConfiguration != null)
      'autoStartConfiguration': autoStartConfiguration,
    if (autoStopConfiguration != null)
      'autoStopConfiguration': autoStopConfiguration,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (diskEncryptionConfiguration != null)
      'diskEncryptionConfiguration': diskEncryptionConfiguration,
    if (identityCenterConfiguration != null)
      'identityCenterConfiguration': identityCenterConfiguration,
    if (imageConfiguration != null) 'imageConfiguration': imageConfiguration,
    if (initialCapacity != null) 'initialCapacity': initialCapacity,
    if (interactiveConfiguration != null)
      'interactiveConfiguration': interactiveConfiguration,
    if (jobLevelCostAllocationConfiguration != null)
      'jobLevelCostAllocationConfiguration':
          jobLevelCostAllocationConfiguration,
    if (maximumCapacity != null) 'maximumCapacity': maximumCapacity,
    if (monitoringConfiguration != null)
      'monitoringConfiguration': monitoringConfiguration,
    if (networkConfiguration != null)
      'networkConfiguration': networkConfiguration,
    if (releaseLabel != null) 'releaseLabel': releaseLabel,
    if (runtimeConfiguration != null)
      'runtimeConfiguration': runtimeConfiguration,
    if (schedulerConfiguration != null)
      'schedulerConfiguration': schedulerConfiguration,
    if (workerTypeSpecifications != null)
      'workerTypeSpecifications': workerTypeSpecifications,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri: '/applications/${Uri.encodeComponent(applicationId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateApplicationResponse.fromJson(response);
}