Difference between revisions of "API List VS"

From VMPanel
Jump to: navigation, search
Line 13: Line 13:
 
'''Example Code:'''
 
'''Example Code:'''
  
<?php
+
  <?php
 
     require_once('VMPanel_API.php');
 
     require_once('VMPanel_API.php');
 
     $apiusernme =  'apiusername';
 
     $apiusernme =  'apiusername';
Line 22: Line 22:
 
     $output = $admin->getAllVmInfo();
 
     $output = $admin->getAllVmInfo();
 
     print_r($output);
 
     print_r($output);
?>
+
  ?>
  
 
'''Returns:'''
 
'''Returns:'''
  
Array
+
  Array
([0] => Array
+
  (
 +
    [0] => Array
 
         (
 
         (
 
             [vmid] => 100
 
             [vmid] => 100
Line 34: Line 35:
 
             [ip] => 172.93.148.224
 
             [ip] => 172.93.148.224
 
         )
 
         )
)
+
  )

Revision as of 15:29, 14 September 2016

List all VPS


Parameters Description
page_number If not specified, then only first 50 records are returned
count Number of records to be returned, default is 50

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
   $admin = new VMPanel_API($ip, $apiusernme, $apipassword, $port);
   $output = $admin->getAllVmInfo();
   print_r($output);
 ?>

Returns:

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