Edit Backup Server

Use the Edit Backup Server API to edit the information about the backup server. These are remote servers on which backup of the VPS is uploaded. After updating the details of the backup server you need to make sure that these details are also updated in the backup plan also. Also use the Test Backup Connectivity API to test the connection to the backup server after it has been edited.

For more information, please refer this Backup Server guide.

HTTP Request

https://hostname:4085/index.php?act=editbackupserver&id=BID

Parameters

NameMethodValueDescriptionRequired
actGETeditbackupserverThe action will edit the backup serverYes
idGETIntThe backup server ID which needs to be editedYes
namePOSTtextUnique name for the Backup ServerYes
hostnamePOSTtextThe hostname that has to given to the backup serverYes
typePOSTtextThe type of server (SSH/FTP)Yes
usernamePOSTtextUsername for the backupserverYes
portPOSTIntThe port that will be used to connect to the serverYes
passwordPOSTtextPassword of the backupserverNo

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['id'] = 4;
    $post['name'] = 'lxc server';
    $post['hostname'] = 'lxc.nuftp.com';
    $post['type'] = 'SSH';
    $post['username'] = 'root';
    $post['password'] = '';
    $post['port'] = 2044;

    $output = $admin->editbackupserver($post);

    print_r(json_encode($output));
?>

Output

{
    "title": "Edit Backup Server",
    "timenow": "1477273778",
    "time_taken": "0.078"
}
Was this helpful to you?