Use the List Backup Server API to list information about the backup servers. These are remote servers on which backup of the VPS image takes place. The list contains details of the available backup servers 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=backupservers
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | backupservers | The action specified to perform operation and retrieve the list of the backup servers | Yes |
page | GET | Int | If not specified, then only first 50 records are returned | No |
reslen | GET | Int | Number of records to be returned, default is 50 | No |
name | POST | text | The name of the backup server | No |
hostname | POST | text | The hostname of the backup server | No |
type | POST | text | Connection Type can be SSH or FTP | 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['name'] = '';
$post['hostname'] = '';
$post['type'] = '';
$output = $admin->backupservers($page, $reslen, $post);
print_r(json_encode($output));
?>
Output
{
"title": "Backup Servers",
"backupservers": {
"1": {
"bid": "1",
"type": "SSH",
"name": "slate_doc_server",
"hostname": "192.168.1.123",
"username": "root",
"port": "22",
"dir": "/tmp/backup"
}
},
"timenow": 1535553888,
"time_taken": "0.219"
}