API Restart VPS

From Virtualizor Wiki
Jump to: navigation, search

Restart 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->restart(1991);
    
    print_r($output);

?>

Returns:

Array
Array
(
    [title] => Virtual Servers
    [vsop] => Array
        (
            [action] => restart
            [id] => 1991
            [serid] => 0
            [output] => Domain 1991 created from /etc/libvirt/qemu/1001.xml

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

        )

    [timenow] => 1400147442
    [time_taken] => 2.844
)