Stop VM

Use Stop VM API to to stop VPS on your server.

HTTP Request

https://hostname:4083/index.php?act=stop&svs=vpsid&do=1

Parameters

NameTypeValueDescriptionRequired
actGETstopThe action used to carry out certain operationYes
doGET1IF set then the particular action will be carried outYes
svsPOSTIntThe id of the vps is passed in order to stop the vpsYes

Sample Code

PHP

<?php
    require_once('/usr/local/virtualizor/sdk/enduser.php');

    $key =  '';
    $pass = '';
    $ip = '';
    $admin = new Virtualizor_Enduser_API($ip, $key, $pass); 
    $vid = 3332;

    $output = $admin->stop($vid);
    print_r(json_encode($output));
?>

Curl

curl -k  -L "https://hostname:4083/index.php?
svs=3560&act=stop&api=json
&apikey=your_api_key&apipass=your_api_pass&do=1"

Output

{
    "uid": "321",
    "act": "stop",
    "timezone": 1,
    "timenow": "September 20, 2016, 6:50 am",
    "vpsid": 3560,
    "username": "test@test.com",
    "user_type": "2",
    "preferences": {
        "fname": "test",
        "lname": "test",
        "theme": "default",
        "language": "english",
        "timezone": 1
    },
    "url": "index.php?",
    "rdns": {
        "pdnsid": null
    },
    "support_link": "http://softaculous.com",
    "disable_login_logo": 1,
    "title": "Stop VPS",
    "done": {
        "msg": "The Shutdown signal has been sent to the VPS"
    },
    "status": 0,
    "output": "",
    "time_taken": "0.590"
}
Was this helpful to you?