Creates a retore job.

Description

  • You can call the operation to create a restore job based on the specified backup file and restore destination.
  • The type of the data source must be the same as the type of the restore destination.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateRestoreJob

The operation that you want to perform. Set the value to CreateRestoreJob.

RestoreType String Yes ECS_FILE

The type of the restore destination. Valid values:

  • ECS_FILE: The system restores data to Elastic Compute Service (ECS) instances.
  • OSS: The system restores data to Object Storage Service (OSS) buckets.
  • NAS: The system restores data to Apsara File Storage NAS file systems.
SnapshotHash String Yes f2fe...

The HASH value of the backup file.

SnapshotId String Yes s-********************

The ID of the backup file.

SourceType String Yes ECS_FILE

The type of the data source. Valid values:

  • ECS_FILE: indicates backup files for ECS instances.
  • OSS: indicates backup files for OSS buckets.
  • NAS: indicates backup files for NAS file systems.
VaultId String Yes v-*********************

The ID of the backup vault to which the backup file belongs.

TargetFileSystemId String No 005494

If the RestoreType parameter is set to NAS, you must specify a value for this parameter. This parameter specifies the ID of the file system to which you want to restore data.

TargetCreateTime Long No 1554347313

If the RestoreType parameter is set to NAS, you must specify a value for this parameter. This parameter specifies the time when the file system was created.

TargetPath String No C:\

If the RestoreType parameter is set to ECS_FILE, you must specify a value for this parameter. This parameter specifies the path to the files that you want to restore.

TargetBucket String No hbr-backup-oss

If the RestoreType parameter is set to OSS, you must specify a value for this parameter. This parameter specifies the name of the OSS bucket to which you want to restore data.

TargetPrefix String No hbr

If the RestoreType parameter is set to OSS, you must specify a value for this parameter. This parameter specifies the prefix of objects that you want to restore.

TargetInstanceId String No i-*********************

If the RestoreType parameter is set to ECS_FILE, you must specify a value for this parameter. This parameter specifies the ID of the ECS instance to which you want to restore data.

Include String No ["/home/alice/*.pdf", "/home/bob/*.txt"]

The paths to which you want to restore data. All files in each specified path are restored. The value must be 1 to 255 characters in length.

Exclude String No ["/var", "/proc"]

The paths to which no data is restored. No files in each specified path are restored. The value must be 1 to 255 characters in length.

Response parameters

Parameter Type Example Description
Code String 200

The HTTP status code. The status code 200 indicates that the request is successful.

Message String successful

The message that is returned. If the request is successful, a value of successful is returned. If the request fails, an error message is returned.

RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

RestoreId String r-*********************

The ID of the restore job.

Success Boolean true

Indicates whether the request is successful. Valid values:

  • true: indicates that the request is successful.
  • false: indicates that the request fails.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateRestoreJob
&RestoreType=ECS_FILE
&SnapshotHash=f2fe...
&SnapshotId=s-********************
&SourceType=ECS_FILE
&VaultId=v-*********************
&<Common request parameters>

Sample success responses

XML format

<CreateRestoreJobResponse>
  <Message>successful</Message>
  <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
  <RestoreId>r-*********************</RestoreId>
  <Code>200</Code>
  <Success>true</Success>
</CreateRestoreJobResponse>

JSON format

{
    "Message": "successful",
    "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
    "RestoreId": "r-*********************",
    "Code": 200,
    "Success": true
}

Error codes

For a list of error codes, visit the API Error Center.