Applies a pending maintenance action to a resource (for example, to an Amazon DocumentDB instance).
Parameters:
-
resource_identifier
(Optional[String], default:
None
)
–
The Amazon Resource Name (ARN) of the resource that the pending maintenance action applies to.
-
apply_action
(Optional[String], default:
None
)
–
The pending maintenance action to apply to this resource.
Valid values: system-update, db-upgrade
-
opt_in_type
(Optional[String], default:
None
)
–
A value that specifies the type of opt-in request or undoes an opt-in request. An opt-in request of type immediate can't be undone.
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_docdb/_services/async_doc_db.py
| async def apply_pending_maintenance_action(
self,
*,
config_overrides: Optional[AsyncDocDBClientConfig] = None,
resource_identifier: Optional["capo_docdb.types.string.String"] = None,
apply_action: Optional["capo_docdb.types.string.String"] = None,
opt_in_type: Optional["capo_docdb.types.string.String"] = None,
) -> "capo_docdb.types.apply_pending_maintenance_action_result.ApplyPendingMaintenanceActionResult":
"""<p>Applies a pending maintenance action to a resource (for example, to an Amazon DocumentDB instance).</p>
Args:
resource_identifier: <p>The Amazon Resource Name (ARN) of the 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>system-update</code>, <code>db-upgrade</code> </p>
opt_in_type: <p>A value that specifies the type of opt-in request or undoes an opt-in request. An opt-in request of type <code>immediate</code> can't be undone.</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_docdb.errors.invalid_db_cluster_state_fault.InvalidDBClusterStateFault: <p>The cluster isn't in a valid state.</p>
capo_docdb.errors.invalid_db_instance_state_fault.InvalidDBInstanceStateFault: <p> The specified instance isn't in the <i>available</i> state. </p>
capo_docdb.errors.resource_not_found_fault.ResourceNotFoundFault: <p>The specified resource ID was not found.</p>
capo_docdb.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_docdb.types.apply_pending_maintenance_action_message.ApplyPendingMaintenanceActionMessage]",
) -> AsyncOperationResponse[
"capo_docdb.types.apply_pending_maintenance_action_result.ApplyPendingMaintenanceActionResult"
]:
import capo_docdb._operations.amazon_rd_sv19.apply_pending_maintenance_action
(
output,
http_response,
) = await capo_docdb._operations.amazon_rd_sv19.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_docdb.types.apply_pending_maintenance_action_message.ApplyPendingMaintenanceActionMessage = {}
if resource_identifier is not None:
input_["resource_identifier"] = resource_identifier
if apply_action is not None:
input_["apply_action"] = apply_action
if opt_in_type is not None:
input_["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
|