Skip to content

apply_pending_maintenance_action async

apply_pending_maintenance_action(
    replication_instance_arn: String,
    apply_action: String,
    opt_in_type: String,
    *,
    config_overrides: Optional[AsyncDatabaseMigrationServiceClientConfig] = None,
) -> ApplyPendingMaintenanceActionResponse

Applies a pending maintenance action to a resource (for example, to a replication instance).

Parameters:

  • replication_instance_arn (String) –

    The Amazon Resource Name (ARN) of the DMS resource that the pending maintenance action applies to.

  • apply_action (String) –

    The pending maintenance action to apply to this resource.

    Valid values: os-upgrade, system-update, db-upgrade, os-patch

  • opt_in_type (String) –

    A value that specifies the type of opt-in request, or undoes an opt-in request. You can't undo an opt-in request of type immediate.

    Valid values:

    • immediate - Apply the maintenance action immediately.

    • next-maintenance - Apply the maintenance action during the next maintenance window for the resource.

    • undo-opt-in - Cancel any existing next-maintenance opt-in requests.

Raises:

Source code in docs_src/capo_database_migration_service/_services/async_database_migration_service.py
async def apply_pending_maintenance_action(
    self,
    replication_instance_arn: "capo_database_migration_service.types.string.String",
    apply_action: "capo_database_migration_service.types.string.String",
    opt_in_type: "capo_database_migration_service.types.string.String",
    *,
    config_overrides: Optional[AsyncDatabaseMigrationServiceClientConfig] = None,
) -> "capo_database_migration_service.types.apply_pending_maintenance_action_response.ApplyPendingMaintenanceActionResponse":
    """<p>Applies a pending maintenance action to a resource (for example, to a replication instance).</p>

    Args:
        replication_instance_arn: <p>The Amazon Resource Name (ARN) of the DMS resource that the pending maintenance action applies to.</p>
        apply_action: <p>The pending maintenance action to apply to this resource.</p> <p>Valid values: <code>os-upgrade</code>, <code>system-update</code>, <code>db-upgrade</code>, <code>os-patch</code> </p>
        opt_in_type: <p>A value that specifies the type of opt-in request, or undoes an opt-in request. You can't undo an opt-in request of type <code>immediate</code>.</p> <p>Valid values:</p> <ul> <li> <p> <code>immediate</code> - Apply the maintenance action immediately.</p> </li> <li> <p> <code>next-maintenance</code> - Apply the maintenance action during the next maintenance window for the resource.</p> </li> <li> <p> <code>undo-opt-in</code> - Cancel any existing <code>next-maintenance</code> opt-in requests.</p> </li> </ul>

    Raises:
        capo_database_migration_service.errors.resource_not_found_fault.ResourceNotFoundFault: <p>The resource could not be found.</p>
        capo_database_migration_service.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_database_migration_service.types.apply_pending_maintenance_action_message.ApplyPendingMaintenanceActionMessage]",
    ) -> AsyncOperationResponse[
        "capo_database_migration_service.types.apply_pending_maintenance_action_response.ApplyPendingMaintenanceActionResponse"
    ]:
        import capo_database_migration_service._operations.amazon_dm_sv20160101.apply_pending_maintenance_action

        (
            output,
            http_response,
        ) = await capo_database_migration_service._operations.amazon_dm_sv20160101.apply_pending_maintenance_action.async_apply_pending_maintenance_action(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ApplyPendingMaintenanceAction")
    )
    input_: capo_database_migration_service.types.apply_pending_maintenance_action_message.ApplyPendingMaintenanceActionMessage = {
        "replication_instance_arn": replication_instance_arn,
        "apply_action": apply_action,
        "opt_in_type": opt_in_type,
    }

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