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
Name | Method | Type | Description | Required |
---|---|---|---|---|
act | GET | text | The action specified to retrieve data after vps is powered off | Yes |
sa | GET | text | The import wizard name of which to use import functionality. | Yes |
ta | GET | text | The action of which we want the data or on which to perform import. | Yes |
changeserid | GET | int | The serid of server on which HyperVM is installed, Provide if setup is on slave server, for master server no need to pass this parameter | No |
Supported "ta" Actions
Value | Description | Return Parameters | Required |
---|---|---|---|
nodes | Provide if you want to view Nodes | hypervm_nodes | Yes |
plans | Provide if you want to view Plans | hypervm_plans | Yes |
users | Provide if you want to view Users | hypervm_users | Yes |
ips | Provide if you want to view IP Pools | hypervm_ipblocks hypervm_ipblocknodes | Yes |
os | Provide if you want to view OS templates | hypervm_templates | Yes |
vps | Provide if you want to view VMs | hypervm_vps | Yes |
Supported Import Functions
Provide the Parameters in Name column to import specific utility.
Name | Method | Type | Description | "ta" | Required |
---|---|---|---|---|---|
hypervm_plans | POST | int | Provide if you want to Import Plans | plans | Yes |
hypervm_users | POST | int | Provide if you want to Import Users | users | Yes |
hypervm_ips | POST | int | Provide if you want to Import IPs | ips | Yes |
hypervm_os | POST | int | Provide if you want to Import OS | os | Yes |
hypervm_vps | POST | int | Provide if you want to Import VPS | vps | Yes |
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"
}