Use the Backup VPS Details API to get the backup information of the VPS. The information consists of the list of the backed up file paths, along with the size of the image in bytes, which are listed according to the date on which the backup of the VPS took place.
For more information, you can refer this Backup Plans guide.
HTTP Request
https://hostname:4085/index.php?act=vpsrestore&op=get_vps
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | vpsrestore | The action will return the backup information of the VPS | Yes |
op | GET | text | The 'op' should be 'get_vps' for getting the VPS information | Yes |
date | POST | int | Date of which you want vps backups (For example 20200313) | NO |
vpsid | POST | Int | The ID of the vps whose backup information is needed | Yes |
Sample Code
<?php
require_once('/usr/local/virtualizor/sdk/admin.php');
$key = 'your_api_key';
$pass = 'your_api_pass';
$ip = 'your_server_ip';
$admin = new Virtualizor_Admin_API($ip, $key, $pass);
$post = array();
$post['vpsid'] = 79;
$output = $admin->vps_backup_list($post);
print_r(json_encode($output));
?>
Output
{
"title": "Restore VPS Backups",
"directories": [
"/tmp/api_backup"
],
"backup_list": {
"20180918": [
{
"abs_path": "/tmp/api_backup/20180918/79.img",
"size": 2147483648
}
]
},
"vps_backup_server": "0",
"vps_backup_dir": "/tmp/api_backup",
"timenow": 1537293793,
"time_taken": "0.223"
}