Skip to content

update_environment async

update_environment(
    environment_id: Identifier,
    *,
    config_overrides: Optional[Asyncm2ClientConfig] = None,
    desired_capacity: Optional[CapacityValue] = None,
    instance_type: Optional[String20] = None,
    engine_version: Optional[EngineVersion] = None,
    preferred_maintenance_window: Optional[str] = None,
    apply_during_maintenance_window: Optional[Boolean] = None,
    force_update: Optional[Boolean] = None,
) -> UpdateEnvironmentResponse

Updates the configuration details for a specific runtime environment.

Parameters:

  • environment_id (Identifier) –

    The unique identifier of the runtime environment that you want to update.

  • desired_capacity (Optional[CapacityValue], default: None ) –

    The desired capacity for the runtime environment to update. The minimum possible value is 0 and the maximum is 100.

  • instance_type (Optional[String20], default: None ) –

    The instance type for the runtime environment to update.

  • engine_version (Optional[EngineVersion], default: None ) –

    The version of the runtime engine for the runtime environment.

  • preferred_maintenance_window (Optional[str], default: None ) –

    Configures the maintenance window that you want for the runtime environment. The maintenance window must have the format ddd:hh24:mi-ddd:hh24:mi and must be less than 24 hours. The following two examples are valid maintenance windows: sun:23:45-mon:00:15 or sat:01:00-sat:03:00.

    If you do not provide a value, a random system-generated value will be assigned.

  • apply_during_maintenance_window (Optional[Boolean], default: None ) –

    Indicates whether to update the runtime environment during the maintenance window. The default is false. Currently, Amazon Web Services Mainframe Modernization accepts the engineVersion parameter only if applyDuringMaintenanceWindow is true. If any parameter other than engineVersion is provided in UpdateEnvironmentRequest, it will fail if applyDuringMaintenanceWindow is set to true.

  • force_update (Optional[Boolean], default: None ) –

    Forces the updates on the environment. This option is needed if the applications in the environment are not stopped or if there are ongoing application-related activities in the environment.

    If you use this option, be aware that it could lead to data corruption in the applications, and that you might need to perform repair and recovery procedures for the applications.

    This option is not needed if the attribute being updated is preferredMaintenanceWindow.

Raises:

Source code in docs_src/capo_m2/_services/async_m2.py
async def update_environment(
    self,
    environment_id: "capo_m2.types.identifier.Identifier",
    *,
    config_overrides: Optional[Asyncm2ClientConfig] = None,
    desired_capacity: Optional["capo_m2.types.capacity_value.CapacityValue"] = None,
    instance_type: Optional["capo_m2.types.string20.String20"] = None,
    engine_version: Optional["capo_m2.types.engine_version.EngineVersion"] = None,
    preferred_maintenance_window: Optional[str] = None,
    apply_during_maintenance_window: Optional[
        "capo_m2.types.boolean.Boolean"
    ] = None,
    force_update: Optional["capo_m2.types.boolean.Boolean"] = None,
) -> "capo_m2.types.update_environment_response.UpdateEnvironmentResponse":
    """<p>Updates the configuration details for a specific runtime environment.</p>

    Args:
        environment_id: <p>The unique identifier of the runtime environment that you want to update.</p>
        desired_capacity: <p>The desired capacity for the runtime environment to update. The minimum possible value is 0 and the maximum is 100.</p>
        instance_type: <p>The instance type for the runtime environment to update.</p>
        engine_version: <p>The version of the runtime engine for the runtime environment.</p>
        preferred_maintenance_window: <p>Configures the maintenance window that you want for the runtime environment. The maintenance window must have the format <code>ddd:hh24:mi-ddd:hh24:mi</code> and must be less than 24 hours. The following two examples are valid maintenance windows: <code>sun:23:45-mon:00:15</code> or <code>sat:01:00-sat:03:00</code>. </p> <p>If you do not provide a value, a random system-generated value will be assigned.</p>
        apply_during_maintenance_window: <p>Indicates whether to update the runtime environment during the maintenance window. The default is false. Currently, Amazon Web Services Mainframe Modernization accepts the <code>engineVersion</code> parameter only if <code>applyDuringMaintenanceWindow</code> is true. If any parameter other than <code>engineVersion</code> is provided in <code>UpdateEnvironmentRequest</code>, it will fail if <code>applyDuringMaintenanceWindow</code> is set to true.</p>
        force_update: <p>Forces the updates on the environment. This option is needed if the applications in the environment are not stopped or if there are ongoing application-related activities in the environment.</p> <p>If you use this option, be aware that it could lead to data corruption in the applications, and that you might need to perform repair and recovery procedures for the applications.</p> <p>This option is not needed if the attribute being updated is <code>preferredMaintenanceWindow</code>.</p>

    Raises:
        capo_m2.errors.access_denied_exception.AccessDeniedException: <p>The account or role doesn't have the right permissions to make the request.</p>
        capo_m2.errors.conflict_exception.ConflictException: <p>The parameters provided in the request conflict with existing resources.</p>
        capo_m2.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred during the processing of the request.</p>
        capo_m2.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_m2.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>One or more quotas for Amazon Web Services Mainframe Modernization exceeds the limit.</p>
        capo_m2.errors.throttling_exception.ThrottlingException: <p>The number of requests made exceeds the limit.</p>
        capo_m2.errors.validation_exception.ValidationException: <p>One or more parameters provided in the request is not valid.</p>
        capo_m2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_m2.types.update_environment_request.UpdateEnvironmentRequest]",
    ) -> AsyncOperationResponse[
        "capo_m2.types.update_environment_response.UpdateEnvironmentResponse"
    ]:
        import capo_m2._operations.aws_supernova_control_plane_service.update_environment

        (
            output,
            http_response,
        ) = await capo_m2._operations.aws_supernova_control_plane_service.update_environment.async_update_environment(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateEnvironment")
    )
    input_: capo_m2.types.update_environment_request.UpdateEnvironmentRequest = {
        "environment_id": environment_id
    }
    if desired_capacity is not None:
        input_["desired_capacity"] = desired_capacity
    if instance_type is not None:
        input_["instance_type"] = instance_type
    if engine_version is not None:
        input_["engine_version"] = engine_version
    if preferred_maintenance_window is not None:
        input_["preferred_maintenance_window"] = preferred_maintenance_window
    if apply_during_maintenance_window is not None:
        input_["apply_during_maintenance_window"] = apply_during_maintenance_window
    if force_update is not None:
        input_["force_update"] = force_update

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output