ListRestoreJobsByProtectedResourceCommand

This returns restore jobs that contain the specified protected resource.

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

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { BackupClient, ListRestoreJobsByProtectedResourceCommand } from "@aws-sdk/client-backup"; // ES Modules import
// const { BackupClient, ListRestoreJobsByProtectedResourceCommand } = require("@aws-sdk/client-backup"); // CommonJS import
const client = new BackupClient(config);
const input = { // ListRestoreJobsByProtectedResourceInput
  ResourceArn: "STRING_VALUE", // required
  ByStatus: "PENDING" || "RUNNING" || "COMPLETED" || "ABORTED" || "FAILED",
  ByRecoveryPointCreationDateAfter: new Date("TIMESTAMP"),
  ByRecoveryPointCreationDateBefore: new Date("TIMESTAMP"),
  NextToken: "STRING_VALUE",
  MaxResults: Number("int"),
};
const command = new ListRestoreJobsByProtectedResourceCommand(input);
const response = await client.send(command);
// { // ListRestoreJobsByProtectedResourceOutput
//   RestoreJobs: [ // RestoreJobsList
//     { // RestoreJobsListMember
//       AccountId: "STRING_VALUE",
//       RestoreJobId: "STRING_VALUE",
//       RecoveryPointArn: "STRING_VALUE",
//       CreationDate: new Date("TIMESTAMP"),
//       CompletionDate: new Date("TIMESTAMP"),
//       Status: "PENDING" || "RUNNING" || "COMPLETED" || "ABORTED" || "FAILED",
//       StatusMessage: "STRING_VALUE",
//       PercentDone: "STRING_VALUE",
//       BackupSizeInBytes: Number("long"),
//       IamRoleArn: "STRING_VALUE",
//       ExpectedCompletionTimeMinutes: Number("long"),
//       CreatedResourceArn: "STRING_VALUE",
//       ResourceType: "STRING_VALUE",
//       RecoveryPointCreationDate: new Date("TIMESTAMP"),
//       CreatedBy: { // RestoreJobCreator
//         RestoreTestingPlanArn: "STRING_VALUE",
//       },
//       ValidationStatus: "FAILED" || "SUCCESSFUL" || "TIMED_OUT" || "VALIDATING",
//       ValidationStatusMessage: "STRING_VALUE",
//       DeletionStatus: "DELETING" || "FAILED" || "SUCCESSFUL",
//       DeletionStatusMessage: "STRING_VALUE",
//     },
//   ],
//   NextToken: "STRING_VALUE",
// };

ListRestoreJobsByProtectedResourceCommand Input

Parameter
Type
Description
ResourceArn
Required
string | undefined

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

ByRecoveryPointCreationDateAfter
Date | undefined

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

ByRecoveryPointCreationDateBefore
Date | undefined

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

ByStatus
RestoreJobStatus | undefined

Returns only restore jobs associated with the specified job status.

MaxResults
number | undefined

The maximum number of items to be returned.

NextToken
string | undefined

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.

ListRestoreJobsByProtectedResourceCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
NextToken
string | undefined

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

RestoreJobs
RestoreJobsListMember[] | undefined

An array of objects that contain detailed information about jobs to restore saved resources.

Throws

Name
Fault
Details
InvalidParameterValueException
client

Indicates that something is wrong with a parameter's value. For example, the value is out of range.

MissingParameterValueException
client

Indicates that a required parameter is missing.

ResourceNotFoundException
client

A resource that is required for the action doesn't exist.

ServiceUnavailableException
server

The request failed due to a temporary failure of the server.

BackupServiceException
Base exception class for all service exceptions from Backup service.