Get Virtualizor

Import Proxmox

API Description

Use the Import Proxmox API to get Import supported utilities.

HTTP Request

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

HTTP Request

https://hostname:4085/index.php?act=import&sa=proxmox&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 Proxmox 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 Nodesproxmox_nodesYes
usersProvide if you want to view Usersproxmox_usersYes
storagesProvide if you want to view Storagesproxmox_templatesYes
vpsProvide if you want to view VMsproxmox_vpsYes

Supported Import Functions

Provide the Parameters in Name column to import specific utility.

NameMethodTypeDescription"ta" Required
proxmox_usersPOSTintProvide if you want to Import UsersusersYes
proxmox_storagesPOSTintProvide if you want to Import StoragesstoragesYes
proxmox_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['proxmox_vps'] = 1; //Provide if you want to import

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

    print_r(json_encode($output));

?>

Output

{
   "title":"Import",
   "proxmox_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