Skip to content

update_application

update_application(
    application_id: ApplicationId,
    client_token: ClientToken,
    *,
    config_overrides: Optional[EMRServerlessClientConfig] = None,
    initial_capacity: Optional[InitialCapacityConfigMap] = None,
    maximum_capacity: Optional[MaximumAllowedResources] = None,
    auto_start_configuration: Optional[AutoStartConfig] = None,
    auto_stop_configuration: Optional[AutoStopConfig] = None,
    network_configuration: Optional[NetworkConfiguration] = None,
    architecture: Optional[Architecture] = None,
    image_configuration: Optional[ImageConfigurationInput] = None,
    worker_type_specifications: Optional[WorkerTypeSpecificationInputMap] = None,
    interactive_configuration: Optional[InteractiveConfiguration] = None,
    release_label: Optional[ReleaseLabel] = None,
    runtime_configuration: Optional[ConfigurationList] = None,
    monitoring_configuration: Optional[MonitoringConfiguration] = None,
    disk_encryption_configuration: Optional[DiskEncryptionConfiguration] = None,
    scheduler_configuration: Optional[SchedulerConfiguration] = None,
    identity_center_configuration: Optional[IdentityCenterConfigurationInput] = None,
    job_level_cost_allocation_configuration: Optional[
        JobLevelCostAllocationConfiguration
    ] = None,
) -> UpdateApplicationResponse

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

Parameters:

  • application_id (ApplicationId) –

    The ID of the application to update.

  • client_token (ClientToken) –

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

  • initial_capacity (Optional[InitialCapacityConfigMap], default: None ) –

    The capacity to initialize when the application is updated.

  • maximum_capacity (Optional[MaximumAllowedResources], default: None ) –

    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.

  • auto_start_configuration (Optional[AutoStartConfig], default: None ) –

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

  • auto_stop_configuration (Optional[AutoStopConfig], default: None ) –

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

  • architecture (Optional[Architecture], default: None ) –

    The CPU architecture of an application.

  • image_configuration (Optional[ImageConfigurationInput], default: None ) –

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

  • worker_type_specifications (Optional[WorkerTypeSpecificationInputMap], default: None ) –

    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.

  • interactive_configuration (Optional[InteractiveConfiguration], default: None ) –

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

  • release_label (Optional[ReleaseLabel], default: None ) –

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

  • runtime_configuration (Optional[ConfigurationList], default: None ) –

    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.

  • monitoring_configuration (Optional[MonitoringConfiguration], default: None ) –

    The configuration setting for monitoring.

  • disk_encryption_configuration (Optional[DiskEncryptionConfiguration], default: None ) –

    The configuration object that allows encrypting local disks.

  • scheduler_configuration (Optional[SchedulerConfiguration], default: None ) –

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

  • identity_center_configuration (Optional[IdentityCenterConfigurationInput], default: None ) –

    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.

  • job_level_cost_allocation_configuration (Optional[JobLevelCostAllocationConfiguration], default: None ) –

    The configuration object that enables job level cost allocation.

Raises:

Source code in docs_src/capo_emr_serverless/_services/emr_serverless.py
def update_application(
    self,
    application_id: "capo_emr_serverless.types.application_id.ApplicationId",
    client_token: "capo_emr_serverless.types.client_token.ClientToken",
    *,
    config_overrides: Optional[EMRServerlessClientConfig] = None,
    initial_capacity: Optional[
        "capo_emr_serverless.types.initial_capacity_config_map.InitialCapacityConfigMap"
    ] = None,
    maximum_capacity: Optional[
        "capo_emr_serverless.types.maximum_allowed_resources.MaximumAllowedResources"
    ] = None,
    auto_start_configuration: Optional[
        "capo_emr_serverless.types.auto_start_config.AutoStartConfig"
    ] = None,
    auto_stop_configuration: Optional[
        "capo_emr_serverless.types.auto_stop_config.AutoStopConfig"
    ] = None,
    network_configuration: Optional[
        "capo_emr_serverless.types.network_configuration.NetworkConfiguration"
    ] = None,
    architecture: Optional[
        "capo_emr_serverless.types.architecture.Architecture"
    ] = None,
    image_configuration: Optional[
        "capo_emr_serverless.types.image_configuration_input.ImageConfigurationInput"
    ] = None,
    worker_type_specifications: Optional[
        "capo_emr_serverless.types.worker_type_specification_input_map.WorkerTypeSpecificationInputMap"
    ] = None,
    interactive_configuration: Optional[
        "capo_emr_serverless.types.interactive_configuration.InteractiveConfiguration"
    ] = None,
    release_label: Optional[
        "capo_emr_serverless.types.release_label.ReleaseLabel"
    ] = None,
    runtime_configuration: Optional[
        "capo_emr_serverless.types.configuration_list.ConfigurationList"
    ] = None,
    monitoring_configuration: Optional[
        "capo_emr_serverless.types.monitoring_configuration.MonitoringConfiguration"
    ] = None,
    disk_encryption_configuration: Optional[
        "capo_emr_serverless.types.disk_encryption_configuration.DiskEncryptionConfiguration"
    ] = None,
    scheduler_configuration: Optional[
        "capo_emr_serverless.types.scheduler_configuration.SchedulerConfiguration"
    ] = None,
    identity_center_configuration: Optional[
        "capo_emr_serverless.types.identity_center_configuration_input.IdentityCenterConfigurationInput"
    ] = None,
    job_level_cost_allocation_configuration: Optional[
        "capo_emr_serverless.types.job_level_cost_allocation_configuration.JobLevelCostAllocationConfiguration"
    ] = None,
) -> "capo_emr_serverless.types.update_application_response.UpdateApplicationResponse":
    """<p>Updates a specified application. An application has to be in a stopped or created state in order to be updated.</p>

    Args:
        application_id: <p>The ID of the application to update.</p>
        client_token: <p>The client idempotency token of the application to update. Its value must be unique for each request.</p>
        initial_capacity: <p>The capacity to initialize when the application is updated.</p>
        maximum_capacity: <p>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.</p>
        auto_start_configuration: <p>The configuration for an application to automatically start on job submission.</p>
        auto_stop_configuration: <p>The configuration for an application to automatically stop after a certain amount of time being idle.</p>
        architecture: <p>The CPU architecture of an application.</p>
        image_configuration: <p>The image configuration to be used for all worker types. You can either set this parameter or <code>imageConfiguration</code> for each worker type in <code>WorkerTypeSpecificationInput</code>.</p>
        worker_type_specifications: <p>The key-value pairs that specify worker type to <code>WorkerTypeSpecificationInput</code>. This parameter must contain all valid worker types for a Spark or Hive application. Valid worker types include <code>Driver</code> and <code>Executor</code> for Spark applications and <code>HiveDriver</code> and <code>TezTask</code> for Hive applications. You can either set image details in this parameter for each worker type, or in <code>imageConfiguration</code> for all worker types.</p>
        interactive_configuration: <p>The interactive configuration object that contains new interactive use cases when the application is updated.</p>
        release_label: <p>The Amazon EMR release label for the application. You can change the release label to use a different release of Amazon EMR.</p>
        runtime_configuration: <p>The <a href="https://docs.aws.amazon.com/emr-serverless/latest/APIReference/API_Configuration.html">Configuration</a> 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.</p>
        monitoring_configuration: <p>The configuration setting for monitoring.</p>
        disk_encryption_configuration: <p>The configuration object that allows encrypting local disks.</p>
        scheduler_configuration: <p>The scheduler configuration for batch and streaming jobs running on this application. Supported with release labels emr-7.0.0 and above.</p>
        identity_center_configuration: <p>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.</p>
        job_level_cost_allocation_configuration: <p>The configuration object that enables job level cost allocation.</p>

    Raises:
        capo_emr_serverless.errors.internal_server_exception.InternalServerException: <p>Request processing failed because of an error or failure with the service.</p>
        capo_emr_serverless.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_emr_serverless.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_emr_serverless.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_emr_serverless.types.update_application_request.UpdateApplicationRequest]",
    ) -> OperationResponse[
        "capo_emr_serverless.types.update_application_response.UpdateApplicationResponse"
    ]:
        import capo_emr_serverless._operations.aws_toledo_web_service.update_application

        output, http_response = (
            capo_emr_serverless._operations.aws_toledo_web_service.update_application.update_application(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_emr_serverless.types.update_application_request.UpdateApplicationRequest",
    ) -> dict[str, Any]:
        import capo_emr_serverless.types.update_application_request

        return (
            capo_emr_serverless.types.update_application_request.redact_sensitive(
                input_
            )
        )

    def _redact_output(
        output: "capo_emr_serverless.types.update_application_response.UpdateApplicationResponse",
    ) -> dict[str, Any]:
        import capo_emr_serverless.types.update_application_response

        return (
            capo_emr_serverless.types.update_application_response.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateApplication",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_emr_serverless.types.update_application_request.UpdateApplicationRequest = {
        "application_id": application_id,
        "client_token": client_token,
    }
    if initial_capacity is not None:
        input_["initial_capacity"] = initial_capacity
    if maximum_capacity is not None:
        input_["maximum_capacity"] = maximum_capacity
    if auto_start_configuration is not None:
        input_["auto_start_configuration"] = auto_start_configuration
    if auto_stop_configuration is not None:
        input_["auto_stop_configuration"] = auto_stop_configuration
    if network_configuration is not None:
        input_["network_configuration"] = network_configuration
    if architecture is not None:
        input_["architecture"] = architecture
    if image_configuration is not None:
        input_["image_configuration"] = image_configuration
    if worker_type_specifications is not None:
        input_["worker_type_specifications"] = worker_type_specifications
    if interactive_configuration is not None:
        input_["interactive_configuration"] = interactive_configuration
    if release_label is not None:
        input_["release_label"] = release_label
    if runtime_configuration is not None:
        input_["runtime_configuration"] = runtime_configuration
    if monitoring_configuration is not None:
        input_["monitoring_configuration"] = monitoring_configuration
    if disk_encryption_configuration is not None:
        input_["disk_encryption_configuration"] = disk_encryption_configuration
    if scheduler_configuration is not None:
        input_["scheduler_configuration"] = scheduler_configuration
    if identity_center_configuration is not None:
        input_["identity_center_configuration"] = identity_center_configuration
    if job_level_cost_allocation_configuration is not None:
        input_["job_level_cost_allocation_configuration"] = (
            job_level_cost_allocation_configuration
        )

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output