Get Virtualizor

Test Backup connectivity

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

NameMethodValueDescriptionRequired
actGETbackupserversThe action will test the connection of the server with backup serverYes
testGETIntThe backup server ID which needs to be tested for connectionYes

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"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list