Skip to content

list_restore_jobs_by_protected_resource

list_restore_jobs_by_protected_resource(
    resource_arn: ARN,
    *,
    config_overrides: Optional[BackupClientConfig] = None,
    by_status: Optional[RestoreJobStatus] = None,
    by_recovery_point_creation_date_after: Optional[timestamp] = None,
    by_recovery_point_creation_date_before: Optional[timestamp] = None,
    next_token: Optional[string] = None,
    max_results: Optional[MaxResults] = None,
) -> ListRestoreJobsByProtectedResourceOutput

This returns restore jobs that contain the specified protected resource.

You must include ResourceArn. You can optionally include NextToken, ByStatus, MaxResults, ByRecoveryPointCreationDateAfter , and ByRecoveryPointCreationDateBefore.

Parameters:

  • resource_arn (ARN) –

    Returns only restore jobs that match the specified resource Amazon Resource Name (ARN).

  • by_status (Optional[RestoreJobStatus], default: None ) –

    Returns only restore jobs associated with the specified job status.

  • by_recovery_point_creation_date_after (Optional[timestamp], default: None ) –

    Returns only restore jobs of recovery points that were created after the specified date.

  • by_recovery_point_creation_date_before (Optional[timestamp], default: None ) –

    Returns only restore jobs of recovery points that were created before the specified date.

  • next_token (Optional[string], default: None ) –

    The next item following a partial list of returned items. For example, if a request ismade to return MaxResults number of items, NextToken allows you to return more items in your list starting at the location pointed to by the next token.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of items to be returned.

Raises:

Source code in docs_src/capo_backup/_services/backup.py
def list_restore_jobs_by_protected_resource(
    self,
    resource_arn: "capo_backup.types.arn.ARN",
    *,
    config_overrides: Optional[BackupClientConfig] = None,
    by_status: Optional[
        "capo_backup.types.restore_job_status.RestoreJobStatus"
    ] = None,
    by_recovery_point_creation_date_after: Optional[
        "capo_backup.types.timestamp.timestamp"
    ] = None,
    by_recovery_point_creation_date_before: Optional[
        "capo_backup.types.timestamp.timestamp"
    ] = None,
    next_token: Optional["capo_backup.types.string.string"] = None,
    max_results: Optional["capo_backup.types.max_results.MaxResults"] = None,
) -> "capo_backup.types.list_restore_jobs_by_protected_resource_output.ListRestoreJobsByProtectedResourceOutput":
    """<p>This returns restore jobs that contain the specified protected resource.</p> <p>You must include <code>ResourceArn</code>. You can optionally include <code>NextToken</code>, <code>ByStatus</code>, <code>MaxResults</code>, <code>ByRecoveryPointCreationDateAfter</code> , and <code>ByRecoveryPointCreationDateBefore</code>.</p>

    Args:
        resource_arn: <p>Returns only restore jobs that match the specified resource Amazon Resource Name (ARN).</p>
        by_status: <p>Returns only restore jobs associated with the specified job status.</p>
        by_recovery_point_creation_date_after: <p>Returns only restore jobs of recovery points that were created after the specified date.</p>
        by_recovery_point_creation_date_before: <p>Returns only restore jobs of recovery points that were created before the specified date.</p>
        next_token: <p>The next item following a partial list of returned items. For example, if a request ismade to return <code>MaxResults</code> number of items, <code>NextToken</code> allows you to return more items in your list starting at the location pointed to by the next token.</p>
        max_results: <p>The maximum number of items to be returned.</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.
    """

    def _handler(
        req: "OperationRequest[capo_backup.types.list_restore_jobs_by_protected_resource_input.ListRestoreJobsByProtectedResourceInput]",
    ) -> OperationResponse[
        "capo_backup.types.list_restore_jobs_by_protected_resource_output.ListRestoreJobsByProtectedResourceOutput"
    ]:
        import capo_backup._operations.cryo_controller_user_manager.list_restore_jobs_by_protected_resource

        output, http_response = (
            capo_backup._operations.cryo_controller_user_manager.list_restore_jobs_by_protected_resource.list_restore_jobs_by_protected_resource(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListRestoreJobsByProtectedResource")
    )
    input_: capo_backup.types.list_restore_jobs_by_protected_resource_input.ListRestoreJobsByProtectedResourceInput = {
        "resource_arn": resource_arn
    }
    if by_status is not None:
        input_["by_status"] = by_status
    if by_recovery_point_creation_date_after is not None:
        input_["by_recovery_point_creation_date_after"] = (
            by_recovery_point_creation_date_after
        )
    if by_recovery_point_creation_date_before is not None:
        input_["by_recovery_point_creation_date_before"] = (
            by_recovery_point_creation_date_before
        )
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output