API Backup Server

From Virtualizor Wiki
Jump to: navigation, search

Add Backup Server

Parameters Type Description
addbackupserver POST Flag to add Backup Server
hostname POST Hostname of the Backup Server
name POST A unique for the Backup Server
type POST TYpe of the Server (FTP / SSH)
username. POST Username for access
password POST Password of the user
port POST Port number

Example Code

<?php

    require_once('admin.php');

    $key =  'uketenhrhpunty5lhgwkcuxxxxxxxxxx';

    $pass = 'yrsofc3tg3tre7bjpfppspxxxxxxxxxx';

    $ip = 'xxx.xxx.xxx.xxx';

    $admin = new Virtualizor_Admin_API($ip, $key, $pass);

    $post = array();
    $post['addbackupserver'] = 1;
    $post['hostname'] = '2testapi.com';
    $post['name'] = '2testapi';
    $post['type'] = 'SSH';
    $post['username'] = 'testapi';
    $post['password'] = 'testapi';
    $post['port'] = 22;

    $output = $admin->addbackupserver($post);
    print_r($output);
?>

Returns:

Array
(
    [title] => Add Backup Server
    [done] => TRUE;
    [error] => 
    [timenow] => 1430984737
    [time_taken] => 0.056
)