Use Delete Self Shutdown API to delete scheduled ( start | stop | restart | power off ) actions on VPS on your server.
HTTP Request
https://hostname:4083/index.php?act=self_shutdown&svs=vpsid
Parameters
Name | Type | Value | Description | Required |
---|---|---|---|---|
act | GET | self_shutdown | The action will shutdown the vps itself dependind on the timing set | Yes |
svs | POST | vpsid | The vps which needs to be shutdown | Yes |
selfshutdown | POST | 1/0 | If set then the vps will be shutdown | Yes |
delete_timer | POST | Int | The timer which will need to be deleted | 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 = 3609;
$post = array();
$post['selfshutdown'] = 1;
$post['delete_timer'] = 10;
$output = $admin->self_shutdown($vid, $post);
print_r(json_encode($output));
?>
Curl
curl -k -X POST -d "delete_timer=9&selfshutdown=1" -L
"https://hostname:4083/index.php?act=self_shutdown&
svs=3609&api=json&apikey=your_api_key&
apipass=your_api_pass"
Output
{
"uid": "372",
"act": "self_shutdown",
"timezone": 1,
"timenow": "October 9, 2016, 2:20 am",
"vpsid": 3609,
"username": "test@test.com",
"user_type": "2",
"preferences": {
"fname": "test",
"lname": "test",
"language": "english",
"theme": "default",
"timezone": 1,
"logo": ""
},
"url": "index.php?",
"rdns": {
"pdnsid": "12"
},
"pdns": {
"pdnsid": "12"
},
"support_link": "http://softaculous.com",
"title": "Self Shutdown",
"self_shutdown": {
"page": {
"start": 0,
"len": 50,
"maxNum": "1"
},
"self_shutdown": {
"11": {
"id": "11",
"vpsid": "3609",
"time": "10/10/2016 12:30",
"action": "2",
"status": null,
"date": "10/10/2016",
"hours": "12",
"minutes": "30"
}
}
},
"done": {
"msg": "Action deleted",
"done": true
},
"time_taken": "0.084"
}