/server/get_server


GET https://api.sitehost.nz/1.0/server/get_server.json

Retrieves the details for a server.

Query Parameters

ParameterTypeRequiredDescription
client_idintegerYesThe ID for the client that the server belongs to.Example: 1
namestringYesThe name of the server.Example: servername

Code Samples

JavaScript PHP Rails Python
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", "https://api.sitehost.nz/1.0/server/get_server.json?apikey=your_key_here&client_id=1&name=servername", false);

xmlHttp.send();

var response = xmlHttp.responseText;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sitehost.nz/1.0/server/get_server.json?apikey=your_key_here&client_id=1&name=servername");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
require 'net/http'
require 'uri'

uri = URI.parse("https://api.sitehost.nz/1.0/server/get_server.json?apikey=your_key_here&client_id=1&name=servername")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)

response = http.request(request)
import requests

uri = 'https://api.sitehost.nz/1.0/server/get_server.json?apikey=your_key_here&client_id=1&name=servername'

response = requests.get(uri)

Response

200:

application/json
{
  "return": {
    "name": "example",
    "label": "Example",
    "client_id": 960001,
    "created": "2016-04-12 11:05:09",
    "type": "VPS",
    "ram": "1024",
    "root": "xvda2",
    "disk": 5,
    "cores": "0",
    "core": "4",
    "arch": "amd64",
    "kernel": "pvgrub-1.0-amd64",
    "initrd": "",
    "modules": "",
    "distro": "ubuntu-trusty",
    "os": "linux",
    "rescue": "0",
    "managed": "0",
    "locked": "0",
    "state": "On",
    "maint_date": "0000-00-00 00:00:00",
    "maint_date_end": "0000-00-00 00:00:00",
    "email_logs": "0",
    "vnc_port": "5906",
    "vnc_screen": "800x600",
    "ip_addr_limit": "5",
    "notes": "",
    "ips": [
      {
        "id": "32287",
        "server_id": "31350",
        "bridge": "xenbr0",
        "mac_addr": "00:0c:29:9b:26:b5",
        "ip_type": "1",
        "prefix": "32",
        "primary": true,
        "addr_family": 4,
        "network_id": "3",
        "rdns": "rdns.192.168.11.90.sth.nz",
        "ip_addr": "192.168.11.90",
        "network": "192.168.11.0",
        "gateway": "192.168.11.1",
        "netmask": "255.255.255.0",
        "broadcast": "192.168.11.255"
      },
      {
        "id": "32288",
        "server_id": "31350",
        "bridge": "xenbr0",
        "mac_addr": "00:0c:29:9b:26:b5",
        "ip_type": "1",
        "prefix": "128",
        "primary": true,
        "addr_family": 6,
        "network_id": "5",
        "rdns": "fc00-192-168-11-0-3b.v6.sitehost.co.nz",
        "ip_addr": "fc00:192:168:11::3b",
        "network": "fc00:192:168:11::",
        "gateway": "fc00:192:168:11::1",
        "netmask": "ffff:ffff:ffff:ffff::",
        "broadcast": "fc00:192:168:11:ffff:ffff:ffff:ffff"
      },
      {
        "id": "32403",
        "server_id": "31350",
        "bridge": "xenbr0",
        "mac_addr": "00:0c:29:9b:26:b5",
        "ip_type": "1",
        "prefix": "32",
        "primary": false,
        "addr_family": 4,
        "network_id": "3",
        "rdns": "rdns.192.168.11.96.sth.nz",
        "ip_addr": "192.168.11.96",
        "network": "192.168.11.0",
        "gateway": "192.168.11.1",
        "netmask": "255.255.255.0",
        "broadcast": "192.168.11.255"
      }
    ],
    "group_id": "1",
    "partitions": {
      "0": {
        "id": "80228",
        "name": "xvda1",
        "device": "example-swap",
        "mountpoint": "swap",
        "size": "1",
        "new_size": "0",
        "fstype": "swap",
        "drbd": "0",
        "backup": "0",
        "disk_total": "0",
        "disk_used": "0",
        "inodes_total": "0",
        "inodes_used": "0",
        "alert_threshold": "1.0",
        "type": "hdd"
      },
      "1": {
        "id": "80230",
        "name": "xvda3",
        "device": "example-disk",
        "mountpoint": "/",
        "size": "5",
        "new_size": "0",
        "fstype": "ext4",
        "drbd": "0",
        "backup": "1",
        "disk_total": "4832",
        "disk_used": "398",
        "inodes_total": "655360",
        "inodes_used": "8355",
        "alert_threshold": "1.0",
        "type": "hdd"
      }
    },
    "backup_types": [],
    "available_kernels": [
      {
        "default": true,
        "kernel": "pvgrub-1.0-amd64",
        "initrd": "",
        "modules": "",
        "hypervisor": "pvgrub"
      }
    ],
    "product_code": "CLDCON1",
    "product_type": "CLDCON",
    "product_name": "Cloud Container - 1 Core",
    "subscription": {
      "code": "CLDCON1",
      "name": "Cloud Container - 1 Core",
      "price": "35"
    },
    "location_name": "NZ - Auckland City",
    "location_code": "AKLCITY",
    "mirror": "0"
  },
  "msg": "Successful",
  "status": true,
  "time": 28.67
}