Get Virtualizor

Import HyperVM

Use the Import HyperVM API to get Import supported utilities.

HTTP Request

https://hostname:4085/index.php?act=import&sa=hypervm&ta=ACTION&changeserid=SERID

Parameters

NameMethodTypeDescriptionRequired
actGETtextThe action specified to retrieve data after vps is powered offYes
saGETtextThe import wizard name of which to use import functionality.Yes
taGETtextThe action of which we want the data or on which to perform import.Yes
changeseridGETintThe serid of server on which HyperVM is installed, Provide if setup is on slave server, for master server no need to pass this parameterNo

Supported "ta" Actions

ValueDescriptionReturn ParametersRequired
nodesProvide if you want to view Nodeshypervm_nodesYes
plansProvide if you want to view Planshypervm_plansYes
usersProvide if you want to view Usershypervm_usersYes
ipsProvide if you want to view IP Poolshypervm_ipblocks
hypervm_ipblocknodes
Yes
osProvide if you want to view OS templateshypervm_templatesYes
vpsProvide if you want to view VMshypervm_vpsYes

Supported Import Functions

Provide the Parameters in Name column to import specific utility.

NameMethodTypeDescription"ta" Required
hypervm_plansPOSTintProvide if you want to Import PlansplansYes
hypervm_usersPOSTintProvide if you want to Import UsersusersYes
hypervm_ipsPOSTintProvide if you want to Import IPsipsYes
hypervm_osPOSTintProvide if you want to Import OSosYes
hypervm_vpsPOSTintProvide if you want to Import VPSvpsYes

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['ta'] = 'vps';
    $post['changeserid'] = 3;
    $post['hypervm_vps'] = 1; //Provide if you want to import

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

    print_r(json_encode($output));

?>

Output

{
   "title":"Import",
   "hypervm_vps":{
      "1216":{
         "status":"stopped",
         "swap":0,
         "type":"proxl",
         "diskwrite":0,
         "vmid":"1216",
         "netout":0,
         "name":"CT1216",
         "uptime":0,
         "maxdisk":4294967296,
         "disk":0,
         "cpus":4,
         "maxmem":268435456,
         "cpu":0,
         "netin":0,
         "mem":0,
         "lock":"",
         "diskread":0,
         "maxswap":0,
         "template":""
      },
      "1298":{
         "cpu":0,
         "netin":0,
         "disk":0,
         "cpus":2,
         "maxmem":536870912,
         "maxswap":134217728,
         "diskread":0,
         "template":"",
         "mem":0,
         "lock":"",
         "diskwrite":0,
         "type":"proxl",
         "swap":0,
         "status":"stopped",
         "netout":0,
         "name":"test",
         "maxdisk":4294967296,
         "uptime":0,
         "vmid":"1298"
      }
},
   "timenow":1609929387,
   "time_taken":"12.63"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list