Skip to content

get_legal_hold async

get_legal_hold(
    legal_hold_id: string, *, config_overrides: Optional[AsyncBackupClientConfig] = None
) -> GetLegalHoldOutput

This action returns details for a specified legal hold. The details are the body of a legal hold in JSON format, in addition to metadata.

Parameters:

  • legal_hold_id (string) –

    The ID of the legal hold.

Raises:

Source code in docs_src/capo_backup/_services/async_backup.py
async def get_legal_hold(
    self,
    legal_hold_id: "capo_backup.types.string.string",
    *,
    config_overrides: Optional[AsyncBackupClientConfig] = None,
) -> "capo_backup.types.get_legal_hold_output.GetLegalHoldOutput":
    """<p>This action returns details for a specified legal hold. The details are the body of a legal hold in JSON format, in addition to metadata.</p>

    Args:
        legal_hold_id: <p>The ID of the 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.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.get_legal_hold_input.GetLegalHoldInput]",
    ) -> AsyncOperationResponse[
        "capo_backup.types.get_legal_hold_output.GetLegalHoldOutput"
    ]:
        import capo_backup._operations.cryo_controller_user_manager.get_legal_hold

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetLegalHold")
    )
    input_: capo_backup.types.get_legal_hold_input.GetLegalHoldInput = {
        "legal_hold_id": legal_hold_id
    }

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