API Get VPS Status

From Virtualizor Wiki
Jump to: navigation, search

Get VPS Status

Parameters Description
vs_status The ids of the VPS (comma separated)

Example Code:

Returns:

<?php

    require_once('admin.php');

    $key =  'uketenhrhpunty5lhgwkcuxxxxxxxxxx';

    $pass = 'yrsofc3tg3tre7bjpfppspxxxxxxxxxx';

    $ip = 'xxx.xxx.xxx.xxx';

    $admin = new Virtualizor_Admin_API($ip, $key, $pass);

    $output = $admin->status(1002);
    
    if($output == 1){
         echo 'VPS is currently running';
    }

?>

Returns:

VPS is currently running

1 : Online
0 : Offline