VPS Management

Index

List all VPS servers

Get a list of Virtual Private Servers (VPS).

Curl

curl "https://rest.websupport.sk/v1/user/:id/vps" -v -u key:signature -H "Date: request_date_time"

Request

GET https://rest.websupport.sk/v1/user/:id/vps HTTP/1.1

Accept: application/json

Response 200

{
  "items": [
    {
      "id": 123456,
      "name": "vpsname"
    }
  ],
  "pager": {
    "page": 1,
    "pagesize": null,
    "items": 1
  }
}

Get a VPS detail

Get VPS detail by id or name.

Curl

curl "https://rest.websupport.sk/v1/user/:id/vps/:id-or-name" -v -u key:signature -H "Date: request_date_time"

Request

GET https://rest.websupport.sk/v1/user/:id/vps/:id-or-name HTTP/1.1

Accept: application/json

Response 200

{
  "id": 123456,
  "name": "vpsname",
  "status": "ACTIVE",
  "created": 1381882379,
  "updated": 1393440856,
  "progress": 0,
  "ips": [
    "195.210.123.123"
  ],
  "reverse_dns": {
    "195.210.123.123": "vpsname.vps.websupport.sk"
  },
  "flavor": {
    "disk": 10,
    "vcpus": 1,
    "ram": 1024,
    "name": "vpsname.1"
  }
}

Get VNC console

Curl

curl "https://rest.websupport.sk/v1/user/:id/vps/:id-or-name/vnc" -v -u key:signature -H "Date: request_date_time"

Request

GET https://rest.websupport.sk/v1/user/:id/vps/:id-or-name/vnc HTTP/1.1

Accept: application/json

Response 200

{
  "id": 51203,
  "name": "katalyzer",
  "vnc": {
    "url": "https://novnc.scaledo.com:6080/vnc_auto.html?token=4bc2c4fc-73a5-434f-aed0-12ab8fcc6abd",
    "token": "4bc2c4fc-73a5-434f-aed0-12ab8fcc6abd",
    "websocket": "novnc.scaledo.com:6080/websockify"
  }
}

Reboot VPS

Curl

curl "https://rest.websupport.sk/v1/user/:id/vps/:id-or-name/reboot" -X PUT -u key:signature -H "Date: request_date_time"

Request

PUT https://rest.websupport.sk/v1/user/:id/vps/:id-or-name/reboot HTTP/1.1

Accept: application/json

Response 200 (success)

{
   "status": "success",
   "item":
   {
       "id": 51203,
       "name": "katalyzer"
   },
   "errors": {}
}

Hard reboot VPS

Curl

curl "https://rest.websupport.sk/v1/user/:id/vps/:id-or-name/hard-reboot" -X PUT -u key:signature -H "Date: request_date_time"

Request

PUT https://rest.websupport.sk/v1/user/:id/vps/:id-or-name/hard-reboot HTTP/1.1

Accept: application/json

Response 200 (success)

{
   "status": "success",
   "item":
   {
       "id": 51203,
       "name": "katalyzer"
   },
   "errors": {}
}

CPU stats

Paramaters for changing time interval and period:

Example:

Curl

curl "https://rest.websupport.sk/v1/user/:id/vps/:id-or-name/cpu-stats" -v -u key:signature -H "Date: request_date_time"

Request

GET https://rest.websupport.sk/v1/user/:id/vps/:id-or-name/cpu-stats HTTP/1.1

Accept: application/json

Response 200

{
  "range": [
    1402824473,
    1403256472
  ],
  "items": [
    {
      "timestamp": 1402786800,
      "write_bytes": 307200,
      "memory_vms": 9362419712,
      "memory_rss": 1524166656,
      "system": 1140,
      "read_bytes": 7,
      "user": 2781
    },
    {
      "timestamp": 1402873200,
      "write_bytes": 143360,
      "memory_vms": 9362419712,
      "memory_rss": 1524355072,
      "system": 1110,
      "read_bytes": 4,
      "user": 2796
    },
    {
      "timestamp": 1402959600,
      "write_bytes": 4993024,
      "memory_vms": 9362419712,
      "memory_rss": 1525071872,
      "system": 1046,
      "read_bytes": 5,
      "user": 2724
    }
    // etc.
  ]
}

Traffic stats

Paramaters for changing time interval and period:

Curl

curl "https://rest.websupport.sk/v1/user/:id/vps/:id-or-name/traffic-stats" -v -u key:signature -H "Date: request_date_time"

Request

GET https://rest.websupport.sk/v1/user/:id/vps/:id-or-name/traffic-stats HTTP/1.1

Accept: application/json

Response 200

{
  "range": [
    1402841985,
    1405520384
  ],
    {
        "timestamp": 1402869600,
        "obyt": 0,
        "opkt": 0,
        "ibyt": 205638,
        "ipkt": 2668
    },
    {
        "timestamp": 1402956000,
        "obyt": 0,
        "opkt": 0,
        "ibyt": 585400,
        "ipkt": 2627
    },
    {
        "timestamp": 1403042400,
        "obyt": 0,
        "opkt": 0,
        "ibyt": 294021,
        "ipkt": 2139
    }
    // etc.
  ]
}

List all VPS snapshots

Retrieve a list of all snapshots for the specified VPS

Curl

curl "https://rest.websupport.sk/v1/user/:id/vps/:id-or-name/snapshot" -v -u key:signature -H "Date: request_date_time"

Request

GET https://rest.websupport.sk/v1/user/:id/vps/:id-or-name/snapshot HTTP/1.1

Accept: application/json

Response 200

{
    "items": [{
        "created": 1402869600,
        "name": "vps.snapshot.1",
        "description": "my description",
        "status": "available"
    }]
}

Create VPS snapshot

Saves the current state of the specified VPS into a snapshot. It is recommended to shut off your server before snapshotting, otherwise we will not be able to guarantee the consistency of the snapshot. This may lead to problems when you decide to restore your server from the snapshot.

Parameters

Name Type Required
description string no

Curl

curl "https://rest.websupport.sk/v1/user/:id/vps/:id-or-name/snapshot" -X POST -d '{"description": "my description"}' -v -u key:signature -H "Date: request_date_time"

Request

POST https://rest.websupport.sk/v1/user/:id/vps/:id-or-name/snapshot HTTP/1.1

Accept: application/json
Content-Type: application/json

{
    "description": "my description"
}

Response 201

{
    "created": 1402869600,
    "name": "vps.snapshot.1",
    "description": "my description",
    "status": "creating"
}

Response 403

{
    "code": 403,
    "message": "Snapshot limit exceeded"
}

Restore VPS from a snapshot

Rollbacks the specified VPS to the state of the specified snapshot.

Curl

curl "https://rest.websupport.sk/v1/user/:id/vps/:id-or-name/snapshot/:snapshot-name" -X POST -v -u key:signature -H "Date: request_date_time"

Request

POST https://rest.websupport.sk/v1/user/:id/vps/:id-or-name/:snapshot-name HTTP/1.1

Accept: application/json

Response: 204

Delete VPS snapshot

Deletes the specified VPS snapshot

Curl

curl "https://rest.websupport.sk/v1/user/:id/vps/:id-or-name/snapshot/:snapshot-name" -X DELETE -v -u key:signature -H "Date: request_date_time"

Request

DELETE https://rest.websupport.sk/v1/user/:id/vps/:id-or-name/:snapshot-name HTTP/1.1

Accept: application/json

Response: 204

raw