Enable Rescue

Use Enable Rescue API to enable rescue mode for VPS on your server.

HTTP Request

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

Parameters

NameTypeValueDescriptionRequired
actGETrescueThe action specified to return the dataYes
vidPOSTIntThe vpsid whose rescue mode has to be activated. This is passed to the URLYes
passwordPOSTpassThe password to be set while activating rescue modeYes
conf_passwordPOSTconfpassThe confirmation for passwordYes
enablerescuePOST1If set, the rescue mode will be activated inside the vpsYes
svsPOSTIntThe vpsid whose rescue has to be activated. This will be passed along with the URLYes

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;
    $pass = 'testrescue';

    $output = $admin->rescue($vid, $pass);

    print_r(json_encode($output));
?>

Curl

 curl -k -X POST -d "enablerescue=1&password=Test_rescue& 
conf_password=Test_rescue" 
-L "https://hostname:4083/index.php?act=rescue&svs=3577&api=json& 
apikey=your_api_key&apipass=your_api_pass&do=1"

Output

{
    "uid": "321",
    "act": "rescue",
    "timezone": 1,
    "timenow": "September 23, 2016, 7:07 am",
    "vpsid": "3008",
    "username": "test@test.com",
    "user_type": "2",
    "preferences": {
        "fname": "test",
        "lname": "test",
        "language": "english",
        "theme": "default",
        "timezone": 1,
        "logo": ""
    },
    "url": "index.php?",
    "rdns": {
        "pdnsid": null
    },
    "support_link": "http://softaculous.com",
    "disable_login_logo": 1,
    "title": "Rescue Mode",
    "done": {
        "msg": "Rescue mode has been enabled successfully"
    },
    "status": null,
    "rescue_enabled": true,
    "output": null,
    "cant_rescue": null,
    "time_taken": "118.6"
}
Was this helpful to you?