This section provides the following topics:
- Input Parameters
- Output Parameters
- Error Codes
This command allows restoring revisions whose ids, and other information (for example snapshot timestamp) have been obtained via Browse calls (either browse backup set, browse snapshot or browse file system).
Input Parameters
The following table provides the parameters and descriptions.
Parameter | Description | ||||||||
items | Array containing information required for restoring files, folders or revisions. | ||||||||
id | Integer representing a previously obtained folder, file or revision id. | ||||||||
type | String. Values are either "file" or "folder." | ||||||||
dateTime | String. Optional for restoring revisions obtained via Browse Backup set or File system APIs. Mandatory only when restoring data obtained via Browse snapshot. This field needs to be populated by the result of the Snapshot list API. | ||||||||
alternatePath | Optional parameter. Specify an alternate folder on where to restore all the data. If not specified, the data is restored to the original location from where it was backed up. | ||||||||
path | String.alternate Folder location. | ||||||||
credentials | Optional. In case the path points to a network share requiring auth. | ||||||||
userName | String. Used to authenticate on that share, in case it requires auth. | ||||||||
password | String. Used to authenticate on that share, in case it requires auth. | ||||||||
restoreFilePermissions | Boolean. Optional parameter. Default value is false. | ||||||||
restoreFileAttributes | Boolean. Optional parameter. Default value is true. | ||||||||
restoreLastModifiedDate | Boolean. Optional parameter. Default value is true. | ||||||||
overwriteOptions | String. Optional parameter. Default value is "DO_NOT_OVERWRITE_ANY" Allowed values are: "DO_NOT_OVERWRITE_ANY" "OVERWRITE_ALL" "AUTO_RENAME_ALL" Description of the values:
|
Example
The following example uses the defaults, except for the alternatePath, which points to another folder.
{
"items": [
{
"id": 1740,
"type": "file"
}
]
}
Output Parameters
Boolean, true or false, showing whether the command was successfully sent to the backup agent. This output does not mean that the restore has succeeded, the restore operation runs asynchronously.
Example POST
POST /v2/accounts/test_acc/computers/0000/restore/filesandfolders
Example Output
{
"alternatePath": {
"path": "string",
"credentials": {
"username": "string",
"password": "string"
}
},
"items": [
{
"id": 0,
"dateTime": "2020-01-28T08:35:18",
"type": "file"
}
],
"overwriteOptions": "DO_NOT_OVERWRITE_ANY",
"restoreLastModifiedDate": true,
"restoreFileAttributes": true,
"restoreFilePermissions": false
}
Online operation
Response status: 204 (for online operation)
Response status: 400 Accepted
Response body:
{
"errors": [
"Could not create item.",
"[alternatepath][path] must be a string",
"[alternatepath][credentials][username] must be set to a string",
"[alternatepath][credentials][password] must be set to a string",
"[alternatepath][credentials] must not be specified for local paths.",
"[alternatepath][path] is invalid: the provided path is neither local or remote",
"[items] is missing or invalid",
"[items][id] is missing or invalid.",
"[items][type] is missing or invalid. Allowed values are file, folder, drive, revision",
"[items][datetime] is invalid.",
"[overwriteoptions] is invalid. Allowed values are do_not_overwrite_any, overwrite_all, auto_rename_all",
"[restorelastmodifieddate] is invalid. Allowed values are either true or false",
"[restorefileattributes] is invalid. Allowed values are either true or false",
"[restorefilepermissions] is invalid. Allowed values are either true or false"
]
}
Since this is an online operation only (have a running agent) the following status code is displayed if you attempt it offline
Offline operation
Response status: 400 Accepted
Response body:
{
"errors": [
"Agent cannot be reached or is offline"
]
}
Error Codes
When restored revision contains a boot volume and it was EFI, and the users chooses to restore as VHD:
"UEFI-based systems can only be restored as VHDX files to ensure they are bootable on Windows Server 2012 R2 or above."
When volumes over 2 TBs are being restored and VHD format is chosen:
"Due to a limitation of the VHD file type, volumes greater than 2040 GB can only be restored as VHDX files."
For destination creation:
CreateFolderFailed: general error. Most likely a local volume is read only or cannot be written to due to permissions on the local file system
Network shares only:
- BackupSetActions_NetworkShareInaccessible - network share address could not be reached
- BackupSetActions_NetworkPathNotFound - the network path could not be found
- BackupSetActions_NetworkShareInvalidAuth - username + password combination failed authentication
- BackupSetActions_NetworkShareNoWritePermissions - username and password ok, but no write permissions for the provided username on that share.