Start VPS

Use the Start VPS API to start the VPS present on your server by passing the VPS ID to the API. The API response contains “done” as “true” on successful start up of the VPS.

HTTP Request

https://hostname:4085/index.php?act=vs&action=start&vpsid=VPSID

Parameters

NameMethodValueDescriptionRequired
actGETvsThe action specified to retrieve data after vps is startedYes
vpsidGETIntThe ID of the vps which needs to be started.Yes
actionGETtextThe value of the action should be “start” for starting the VPSYes

Sample Code

<?php

    require_once('/usr/local/virtualizor/sdk/admin.php');

    $key =  'your_api_key';
    $pass = 'your_api_pass';
    $ip = 'your_server_ip';

    $admin = new Virtualizor_Admin_API($ip, $key, $pass);

    $vid = 3582;

    $output = $admin->start($vid);

    print_r(json_encode($output));

?>

Output

{
  "title": "Virtual Servers",
  "done": true,
  "done_msg": "VPS has been started successfully",
  "vsop": {
    "action": "start",
    "id": 51,
    "serid": "0",
    "output": "Domain v1009 created from /etc/libvirt/qemu/v1009.xml\n",
    "status": {
      "51": 1
    }
  },
  "timenow": 1535125750,
  "time_taken": "4.432"
}
Was this helpful to you?