Start Self Shutdown

Use Start Self Shutdown API to automatically schedule ( start | stop | restart | power off ) actions on VPS at time specified on your server.

HTTP Request

https://hostname:4083/index.php?act=self_shutdown&svs=vpsid

Parameters

NameTypeValueDescriptionRequired
actGETself_shutdownThe action specified to retrieve dataYes
svsPOSTIntThe vps id which is needed to set the shutdown timerYes
selfshutdownPOST1IF set, the shutdown time will be savedYes
shutdown_actionPOST0-3What action has to be carried out(Start/Stop/Restart/Poweroff)Yes
shutdown_datePOSTmm/dd/yyyyThe date when self shtudown action should be carried outYes
shutdown_hrsPOSThhTime in hrs for self shutdownYes
shutdown_minPOSTmmTime in mins for self shutdownYes

Action

Shutdown actionValues
Start0
Stop1
Restart2
Power Off3

Sample Code

PHP

<?php
    require_once('/usr/local/virtualizor/sdk/enduser.php');
    $key =  '';
    $pass = '';
    $ip = '';
    $admin = new Virtualizor_Enduser_API($ip, $key, $pass);

    $vid = 3384;
    $post = array();
    $post['selfshutdown'] = 1;
    $post['shutdown_action'] = 3;
    $post['shutdown_date'] = '08/29/2016';
    $post['shutdown_hrs'] =  12;
    $post['shutdown_min'] = 36;

    $output = $admin->self_shutdown($vid, $post);

    print_r(json_encode($output));
?>

Curl

curl -k -X POST -d "selfshutdown=1&shutdown_action=1& 
shutdown_date=09/26/2016&shutdown_hrs=03&shutdown_min=45" -L 
"https://hostname:4083/index.php?act=self_shutdown&svs=3511&api=json 
&apikey=your_api_key&apipass=your_api_pass&do=1"

Output

{
    "uid": "321",
    "act": "self_shutdown",
    "timezone": 0,
    "timenow": "September 25, 2016, 4:36 am",
    "vpsid": 3511,
    "username": "test@test.com",
    "user_type": "2",
    "preferences": {
        "fname": "test",
        "lname": "test",
        "language": "english",
        "theme": "default",
        "timezone": 0,
        "logo": ""
    },
    "url": "index.php?",
    "rdns": {
        "pdnsid": null
    },
    "support_link": "http://softaculous.com",
    "disable_login_logo": 1,
    "title": "Self Shutdown",
    "error": {
        "timesp": "1474778163"
    },
    "self_shutdown": {
        "page": {
            "start": 0,
            "len": 50,
            "maxNum": "1"
        },
        "self_shutdown": {
            "6": {
                "id": "6",
                "vpsid": "3511",
                "time": "09/26/2016 03:45",
                "action": "1",
                "status": null,
                "date": "09/26/2016",
                "hours": "03",
                "minutes": "45"
            }
        }
    },
    "done": {
        "msg": "Action added",
        "done": true
    },
    "time_taken": "0.108"
}
Was this helpful to you?