Backup plans enable you to create different VPS backup settings for different VPS on the same server(s). You can assign backup plans to individual VPS or to the entire VPS plan. You can also allow the endusers to initiate backup/restore of their VPS at their will in the backup plan. Use the List Backup Plans API to list the backup plans present on the Virtualizor panel. The API response will contain a list of information about the backup plans, listed according to their IDs. To filter or limit the size of the list, you can specify one or more query parameters.
See also : Backup Plans guide.
HTTP Request
https://hostname:4085/index.php?act=backup_plans
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | backup_plans | The action specified to perform operation and return list of backup plans | Yes |
reslen | GET | Int | Number of records to be returned, default is 50 | No |
page | GET | Int | Page number, each page show 50 records | No |
planname | POST | text | Search using the backup plan name | No |
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);
$page = 1;
$reslen = 10;
$post = array();
$post['planname'] = '';
$output = $admin->listbackupplans($page,$reslen,$post);
print_r(json_encode($output));
?>
Output
{
"title": "Backup Plans",
"backup_plans": {
"1": {
"bpid": "1",
"disabled": "0",
"plan_name": "New backup plan",
"bid": "0",
"frequency": "hourly",
"run_time": "00:00",
"hourly_freq": "1",
"run_day": "1",
"run_date": "1",
"rotation": "1",
"backup_limit": "0",
"restore_limit": "0",
"enable_enduser_backup_servers": "0",
"nice": "-20",
"ionice_prio": "0",
"ionice_class": "1",
"disable_compression": "0",
"dir": "/tmp/ali_backup",
"backup_server": "Local"
}
},
"timenow": 1536947329,
"time_taken": "0.140"
}