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[DatabaseMigrationServiceClientConfig] = 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.
"""
def _handler(
req: "OperationRequest[capo_database_migration_service.types.apply_pending_maintenance_action_message.ApplyPendingMaintenanceActionMessage]",
) -> OperationResponse[
"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 = (
capo_database_migration_service._operations.amazon_dm_sv20160101.apply_pending_maintenance_action.apply_pending_maintenance_action(
req.options, req.input
)
)
return OperationResponse(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 = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output