Get Virtualizor
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
ssh_keyPOSTtextPass 1 to enable ssh key authenticationNo
sshpub_keyPOSTtextProvide the public key (compulsory if ssh_key is passed).No
sshpri_keyPOSTtextProvide the Private key (compulsory if ssh_key is passed).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);

    $post= array();
    $post['id'] = 4;
    $post['name'] = 'lxc server';
    $post['hostname'] = 'lxc.nuftp.com';
    $post['type'] = 'SSH';
    $post['username'] = 'root';
    $post['password'] = '';
$post['ssh_key'] = 1; //pass only if you want to use keys to authenticate
$post[
'sshpub_key'] = 'YOUR PUBLIC KEY'; //pass only if ssh_key is set
$post['sshpri_key'] = 'YOUR PRIVATE KEY'; //pass only if ssh_key is set $post['port'] = 2044; $output = $admin->editbackupserver($post); print_r(json_encode($output)); ?>

Output

{
    "title": "Edit Backup Server",
    "done": "true",
    "timenow": "1477273778",
    "time_taken": "0.078"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list