API List VS

From VMPanel
Jump to: navigation, search

List all VPS


Example Code:

  <?php
   require_once('VMPanel_API.php');
   $apiusernme =  'apiusername';
   $apipassword = 'apipassword';
   $ip = 'xxx.xxx.xxx.xxx';
   $port = 873; // Other Ports : 2021 , 2022 , 2023 , 2082 , 2222
   $vmpanel = new VMPanel_API($ip, $apiusernme, $apipassword, $port);
   $output = $vmpanel->getAllVmInfo();
   print_r($output);
  ?>

Returns:

 Array
 (
   [0] => Array
       (
           [vmid] => 100
           [name] => hostname
           [os] => Win
           [ip] => 172.93.148.224
       )
 )