/bandwidth/list_resources
GET https://api.sitehost.nz/1.2/bandwidth/list_resources.json
Lists all resources for specific client.
Query Parameters
Parameter | Type | Required | Description |
client_id | integer | Yes | The ID for the client.Example: 1 |
Code Samples
JavaScript PHP Rails Pythonvar xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", "https://api.sitehost.nz/1.2/bandwidth/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.2/bandwidth/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.2/bandwidth/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.2/bandwidth/list_resources.json?apikey=your_key_here&client_id=1'
response = requests.get(uri)
Response
200:application/json
{
"return": [
{
"client_id": "2",
"group_id": "1",
"group_name": "NZ Linux VPS's",
"quotas": [
{
"attribute_id": "1",
"attribute_name": "VPS Disk Space",
"attribute_unit": "GB",
"attribute_type": "0",
"total_units": "48",
"used_units": 0,
"available_units": 48,
"objects": []
},
{
"attribute_id": "2",
"attribute_name": "VPS Memory",
"attribute_unit": "MB",
"attribute_type": "0",
"total_units": "2048",
"used_units": 0,
"available_units": 2048,
"objects": []
}
]
},
{
"client_id": "2",
"group_id": "2",
"group_name": "NZ VPS Containers",
"quotas": [
{
"attribute_id": "1",
"attribute_name": "VPS Disk Space",
"attribute_unit": "GB",
"attribute_type": "0",
"total_units": "6",
"used_units": 0,
"available_units": 6,
"objects": []
},
{
"attribute_id": "2",
"attribute_name": "VPS Memory",
"attribute_unit": "MB",
"attribute_type": "0",
"total_units": "256",
"used_units": 0,
"available_units": 256,
"objects": []
}
]
}
],
"msg": "Successful.",
"status": true
}
"return": [
{
"client_id": "2",
"group_id": "1",
"group_name": "NZ Linux VPS's",
"quotas": [
{
"attribute_id": "1",
"attribute_name": "VPS Disk Space",
"attribute_unit": "GB",
"attribute_type": "0",
"total_units": "48",
"used_units": 0,
"available_units": 48,
"objects": []
},
{
"attribute_id": "2",
"attribute_name": "VPS Memory",
"attribute_unit": "MB",
"attribute_type": "0",
"total_units": "2048",
"used_units": 0,
"available_units": 2048,
"objects": []
}
]
},
{
"client_id": "2",
"group_id": "2",
"group_name": "NZ VPS Containers",
"quotas": [
{
"attribute_id": "1",
"attribute_name": "VPS Disk Space",
"attribute_unit": "GB",
"attribute_type": "0",
"total_units": "6",
"used_units": 0,
"available_units": 6,
"objects": []
},
{
"attribute_id": "2",
"attribute_name": "VPS Memory",
"attribute_unit": "MB",
"attribute_type": "0",
"total_units": "256",
"used_units": 0,
"available_units": 256,
"objects": []
}
]
}
],
"msg": "Successful.",
"status": true
}