/bandwidth/get_ip_list


GET https://api.sitehost.nz/1.0/bandwidth/get_ip_list.json

Gets a list of IP addresses.

Query Parameters

ParameterTypeRequiredDescription
client_idintegerYesThe ID for the client.Example: 1
include_subnetsbooleanReturn the subnets.Example: 0
filter_for_alertsbooleanFilter for alerts.Example: 0

Code Samples

JavaScript PHP Rails Python
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", "https://api.sitehost.nz/1.0/bandwidth/get_ip_list.json?apikey=your_key_here&client_id=1&include_subnets=0&filter_for_alerts=0", false);

xmlHttp.send();

var response = xmlHttp.responseText;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.sitehost.nz/1.0/bandwidth/get_ip_list.json?apikey=your_key_here&client_id=1&include_subnets=0&filter_for_alerts=0");
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/bandwidth/get_ip_list.json?apikey=your_key_here&client_id=1&include_subnets=0&filter_for_alerts=0")
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/bandwidth/get_ip_list.json?apikey=your_key_here&client_id=1&include_subnets=0&filter_for_alerts=0'

response = requests.get(uri)

Response

200:

application/json
{
  "return": {
    "subnets": {
      "/24": {
        "ip_addr": false,
        "netmask": "255.255.255.0",
        "prefix": 24
      },
      "/64": {
        "ip_addr": false,
        "netmask": "ffff:ffff:ffff:ffff::",
        "prefix": 64
      }
    },
    "addresses": {
      "192.168.1.0/24/24": {
        "ip_addr": "192.168.1.0/24",
        "netmask": "255.255.255.0",
        "prefix": "24",
        "rdns": null
      },
      "192.168.1.105/32/32": {
        "ip_addr": "192.168.1.105/32",
        "netmask": "255.255.255.0",
        "prefix": "32",
        "rdns": "192-168-1-105.sitehost.co.nz"
      },
      "192.168.9.0/29/29": {
        "ip_addr": "192.168.9.0/29",
        "netmask": "255.255.255.0",
        "prefix": "29",
        "rdns": "192-168-9-0.sitehost.co.nz"
      },
      "192.168.9.0/28/28": {
        "ip_addr": "192.168.9.0/28",
        "netmask": "255.255.255.0",
        "prefix": "28",
        "rdns": "192-168-9-0.sitehost.co.nz"
      },
      "fc00:10:2:2::/128/128": {
        "ip_addr": "fc00:10:2:2::/128",
        "netmask": "ffff:ffff:ffff:ffff::",
        "prefix": "128",
        "rdns": null
      },
      "fc00:10:2:2::1/128/128": {
        "ip_addr": "fc00:10:2:2::1/128",
        "netmask": "ffff:ffff:ffff:ffff::",
        "prefix": "128",
        "rdns": null
      },
      "fc00:10:2:2::2/128/128": {
        "ip_addr": "fc00:10:2:2::2/128",
        "netmask": "ffff:ffff:ffff:ffff::",
        "prefix": "128",
        "rdns": null
      }
    }
  },
  "msg": "Successful",
  "status": true,
  "time": 134.82
}