4 functions, invoked through the cpanel_uapi tool.
scope cpanel:uapi
Call any function with cpanel_uapi(service_id, module="Restore", function, params). Live availability depends on the cPanel features JetHost has enabled on your account — call list_cpanel_operations to see what is active.
This function lists all of the backup files and directories in the user's home directory.
Important:
When you disable the File Storage role, the system disables this function.
pathstringRequired
A path to a subdirectory within the user's home directory, or any level below it. Note: The value of this parameter must begin and end with a forward slash (/) for security purposes.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
conflictinteger
Whether a difference exists between the type and onDiskType returns. 1 - Conflict exists. 0 - No conflict exists.
One of: 01
existsinteger
Whether the file exists in the user's directory or only in the backup. 1 - File exists in the user's directory. 0 - File exists only in the backup.
One of: 01
namestring
The name of the file or directory.
onDiskTypestring
The item type stored on the disk. dir - A directory. file - A file. symlink - A symlink. unknown - An unknown file type.
One of: dirfilesymlinkunknown
typestring
The item type stored in the backup. dir - A directory. file - A file. symlink - A symlink. unknown - An unknown file type.
This function lists all of an item's backup locations. An item can be a file, a directory, or a symlink.
Important:
When you disable the File Storage role, the system disables this function.
pathstringRequired
A file, directory, or symlink in the user's directory tree. Note: The value of this parameter must begin with a forward slash (/).
existsintegerOptional
Whether to show the exist return, which indicates whether the item exists in the local disk or only in the backup. 1 — Show the exist return's value. 0 — Do not show the exists return's value.
Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:
backupDatestring
The date when the system created the backup.
backupIDstring
The backup's identification. A date, in YYYY-MM-DD format. incremental — An incremental daily backup. The backup frequency (weekly or monthly) , a slash character (/), and the value incremental. The backup frequency (weekly or monthly), a slash character (/), and the backup date, in YYYY-MM-DD format.
backupTypestring
The backup type. compressed — A compressed tar file. incremental — A full tree of files and directories. * uncompressed — An uncompressed tar file.
One of: compressedincrementaluncompressed
existsinteger
Whether the item (a file, a directory, or a symlink) exists in the local disk or only in the backup. 1 — The item exists in the local disk. 0 — The item exists only in the backup. Note: This return appears only if you set the exists parameter to 1.
One of: 10
fileSizeinteger
The size, in bytes, of the file in the backup. Note: The function returns this value only if the item is a file.
mtimeinteger
The file's last modification time.
pathstring
The identical file path value that the system passed in the function.
typestring
The item type stored in the backup. dir — A directory. file — A file. symlink — A symlink. unknown — An unknown file type.
This function restores a file or directory from a backup to the file or directory's original location.
Important:
When you disable the File Storage role, the system disables this function.
backupIDmixedRequired
The backup's identification. YYYY-MM-DD — Restore a daily backup from the specified backup date. incremental — Restore a daily incremental backup. weekly/YYYY-MM-DD — Restore a weekly backup from the specified backup date. monthly/YYYY-MM-DD — Restore a monthly backup from the specified backup date. weekly/incremental — Restore a weekly incremental backup. monthly/incremental — Restore a monthly incremental backup.
overwriteintegerRequired
Whether to overwrite the file or directory on the disc with its backup replacement. 1 — Overwrite the file or directory. 0 — Do not overwrite the file or directory.
pathstringRequired
The absolute file or directory's path, within a backup, that you wish to restore. Important: The value of this parameter must begin with a forward slash (/). You must parse filenames properly to prevent a cross-site scripting (XSS) attack.
Response — normalized as { ok, data, errors[], warnings[] }; data contains: