/server/list_resources


GET https://api.sitehost.nz/1.3/server/list_resources.json

Lists resources available to a client.

Query Parameters

ParameterTypeRequiredDescription
client_idintegerYesThe ID for the client.Example: 1

Code Samples

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

xmlHttp.send();

var response = xmlHttp.responseText;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sitehost.nz/1.3/server/list_resources.json?apikey=your_key_here&client_id=1");
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.3/server/list_resources.json?apikey=your_key_here&client_id=1")
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.3/server/list_resources.json?apikey=your_key_here&client_id=1'

response = requests.get(uri)

Response

200:

application/json
{
  "return": [
    {
      "client_id": "22",
      "group_id": "1",
      "group_name": "NZ - Linux Servers",
      "quotas": [
        {
          "attribute_id": "1",
          "attribute_name": "VPS Disk Space",
          "attribute_unit": "GB",
          "attribute_type": "0",
          "total_units": "15",
          "used_units": "15",
          "available_units": 0,
          "objects": [
            "servername"
          ]
        },
        {
          "attribute_id": "2",
          "attribute_name": "VPS Memory",
          "attribute_unit": "MB",
          "attribute_type": "0",
          "total_units": "1024",
          "used_units": "1024",
          "available_units": 0,
          "objects": [
            "servername"
          ]
        }
      ]
    }
  ],
  "msg": "Successful",
  "status": true
}