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
Name | Type | Value | Description | Required |
---|---|---|---|---|
act | GET | rescue | The action specified to return the data | Yes |
vid | POST | Int | The vpsid whose rescue mode has to be activated. This is passed to the URL | Yes |
password | POST | pass | The password to be set while activating rescue mode | Yes |
conf_password | POST | confpass | The confirmation for password | Yes |
enablerescue | POST | 1 | If set, the rescue mode will be activated inside the vps | Yes |
svs | POST | Int | The vpsid whose rescue has to be activated. This will be passed along with the URL | Yes |
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"
}