Skip to content

cancel_legal_hold async

cancel_legal_hold(
    legal_hold_id: string,
    cancel_description: string,
    *,
    config_overrides: Optional[AsyncBackupClientConfig] = None,
    retain_record_in_days: Optional[Long] = None,
) -> CancelLegalHoldOutput

Removes the specified legal hold on a recovery point. This action can only be performed by a user with sufficient permissions.

Parameters:

  • legal_hold_id (string) –

    The ID of the legal hold.

  • cancel_description (string) –

    A string the describes the reason for removing the legal hold.

  • retain_record_in_days (Optional[Long], default: None ) –

    The integer amount, in days, after which to remove legal hold.

Raises:

Source code in docs_src/capo_backup/_services/async_backup.py
async def cancel_legal_hold(
    self,
    legal_hold_id: "capo_backup.types.string.string",
    cancel_description: "capo_backup.types.string.string",
    *,
    config_overrides: Optional[AsyncBackupClientConfig] = None,
    retain_record_in_days: Optional["capo_backup.types.long.Long"] = None,
) -> "capo_backup.types.cancel_legal_hold_output.CancelLegalHoldOutput":
    """<p>Removes the specified legal hold on a recovery point. This action can only be performed by a user with sufficient permissions.</p>

    Args:
        legal_hold_id: <p>The ID of the legal hold.</p>
        cancel_description: <p>A string the describes the reason for removing the legal hold.</p>
        retain_record_in_days: <p>The integer amount, in days, after which to remove legal hold.</p>

    Raises:
        capo_backup.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>Indicates that something is wrong with a parameter's value. For example, the value is out of range.</p>
        capo_backup.errors.invalid_resource_state_exception.InvalidResourceStateException: <p>Backup is already performing an action on this recovery point. It can't perform the action you requested until the first action finishes. Try again later.</p>
        capo_backup.errors.missing_parameter_value_exception.MissingParameterValueException: <p>Indicates that a required parameter is missing.</p>
        capo_backup.errors.resource_not_found_exception.ResourceNotFoundException: <p>A resource that is required for the action doesn't exist.</p>
        capo_backup.errors.service_unavailable_exception.ServiceUnavailableException: <p>The request failed due to a temporary failure of the server.</p>
        capo_backup.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_backup.types.cancel_legal_hold_input.CancelLegalHoldInput]",
    ) -> AsyncOperationResponse[
        "capo_backup.types.cancel_legal_hold_output.CancelLegalHoldOutput"
    ]:
        import capo_backup._operations.cryo_controller_user_manager.cancel_legal_hold

        (
            output,
            http_response,
        ) = await capo_backup._operations.cryo_controller_user_manager.cancel_legal_hold.async_cancel_legal_hold(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CancelLegalHold")
    )
    input_: capo_backup.types.cancel_legal_hold_input.CancelLegalHoldInput = {
        "legal_hold_id": legal_hold_id,
        "cancel_description": cancel_description,
    }
    if retain_record_in_days is not None:
        input_["retain_record_in_days"] = retain_record_in_days

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