createApplication method

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

Creates an application.

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

Parameter releaseLabel : The Amazon EMR release associated with the application.

Parameter type : The type of application you want to start, such as Spark or Hive.

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 create. Its value must be unique for each request.

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

Parameter identityCenterConfiguration : The IAM Identity Center Configuration accepts the Identity Center instance parameter required to enable trusted identity propagation. This configuration allows identity propagation between integrated services and the Identity Center instance.

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

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

Parameter interactiveConfiguration : The interactive configuration object that enables the interactive use cases to use when running an application.

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

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

Parameter monitoringConfiguration : The configuration setting for monitoring.

Parameter name : The name of the application.

Parameter networkConfiguration : The network configuration for customer VPC connectivity.

Parameter runtimeConfiguration : The Configuration specifications to use when creating an application. Each configuration consists of a classification and properties. This configuration is applied to 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 tags : The tags assigned to the application.

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<CreateApplicationResponse> createApplication({
  required String releaseLabel,
  required String type,
  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,
  String? name,
  NetworkConfiguration? networkConfiguration,
  List<Configuration>? runtimeConfiguration,
  SchedulerConfiguration? schedulerConfiguration,
  Map<String, String>? tags,
  Map<String, WorkerTypeSpecificationInput>? workerTypeSpecifications,
}) async {
  final $payload = <String, dynamic>{
    'releaseLabel': releaseLabel,
    'type': type,
    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 (name != null) 'name': name,
    if (networkConfiguration != null)
      'networkConfiguration': networkConfiguration,
    if (runtimeConfiguration != null)
      'runtimeConfiguration': runtimeConfiguration,
    if (schedulerConfiguration != null)
      'schedulerConfiguration': schedulerConfiguration,
    if (tags != null) 'tags': tags,
    if (workerTypeSpecifications != null)
      'workerTypeSpecifications': workerTypeSpecifications,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/applications',
    exceptionFnMap: _exceptionFns,
  );
  return CreateApplicationResponse.fromJson(response);
}