API Stop VPS

From Virtualizor Wiki
Jump to: navigation, search

Stop a VPS (Master and Slave)


Parameters Description
vpsid VPSID is VID of the VPS.

Example Code:

<?php

    require_once('admin.php');

    $key =  'uketenhrhpunty5lhgwkcuxxxxxxxxxx';

    $pass = 'yrsofc3tg3tre7bjpfppspxxxxxxxxxx';

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

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

    $output = $admin->stop(1991);
    
    print_r($output);

?>

Returns:

Array
(
    [title] => Virtual Servers
    [vsop] => Array
        (
            [action] => stop
            [id] => 1991
            [serid] => 0
            [output] => Domain 1991 is being shutdown

            [status] => Array
                (
                    [1991] => 1
                )

        )

    [timenow] => 1400147182
    [time_taken] => 0.090
)