Use the Test Backup connectivity API to test the connection between the main server and the backup server. The API will return "test_result" as "success" successful FTP/SSH connection. It is recommended that you run this API after adding or editing the backup server.
HTTP Request
https://hostname:4085/index.php?act=backupservers&test=ID
Parameters
Name | Method | Value | Description | Required |
---|---|---|---|---|
act | GET | backupservers | The action will test the connection of the server with backup server | Yes |
test | GET | Int | The backup server ID which needs to be tested for connection | 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['test'] = 1;
$output = $admin->testbackupservers($post);
print_r(json_encode($output));
?>
Output
{
"title": "Backup Servers",
"test_result": "success",
"timenow": 1535557349,
"time_taken": "0.361"
}