Difference between revisions of "API List VS"
From VMPanel
(→List all VPS) |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
=== List all VPS === | === List all VPS === | ||
---- | ---- | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
'''Example Code:''' | '''Example Code:''' | ||
− | <?php | + | <?php |
− | + | ||
require_once('VMPanel_API.php'); | require_once('VMPanel_API.php'); | ||
$apiusernme = 'apiusername'; | $apiusernme = 'apiusername'; | ||
Line 20: | Line 10: | ||
$ip = 'xxx.xxx.xxx.xxx'; | $ip = 'xxx.xxx.xxx.xxx'; | ||
$port = 873; // Other Ports : 2021 , 2022 , 2023 , 2082 , 2222 | $port = 873; // Other Ports : 2021 , 2022 , 2023 , 2082 , 2222 | ||
− | $ | + | $vmpanel = new VMPanel_API($ip, $apiusernme, $apipassword, $port); |
− | $output = $ | + | $output = $vmpanel->getAllVmInfo(); |
print_r($output); | print_r($output); | ||
− | + | ?> | |
− | ?> | + | |
'''Returns:''' | '''Returns:''' | ||
− | Array | + | Array |
− | ( | + | ( |
[0] => Array | [0] => Array | ||
( | ( | ||
Line 37: | Line 26: | ||
[ip] => 172.93.148.224 | [ip] => 172.93.148.224 | ||
) | ) | ||
− | + | ) | |
− | ) | + |
Latest revision as of 15:45, 14 September 2016
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 ) )