Get Virtualizor

Search IP Pool

An IP Pool is a collection of IPs which can be used to create VPS. Use the Search IP Pool API to search the IP pools present on your server. The API response will contain all the details of the IP pool listed according to their IDs.

See also: Add IP pool guide.

HTTP Request

https://hostname:4085/index.php?act=ippool&poolname=POOLNAME&poolgateway=POOLGATEWAY&netmask=NETMASK&nameserver=NAMESERVER&page=PAGE&reslen=RESLEN

Parameters

NameMethodValueDescriptionRequired
actGETippoolThe action will perform the operation and will return an array according to passed search parametersYes
poolnameGETtextThe name of the ip poolNo
poolgatewayGETtextThe gateway of the poolNo
netmaskGETtextThe netmask of the poolNo
nameserverGETtextThe nameserver of the poolNo
servers_searchIntSearch IPs using server ID (Specify -1 to get data from all servers)No
reslenGETIntNumber of records to be returned, default is 50No
pageGETIntPage number, each page show 50 recordsNo

Sample Code

<?php

    require_once('/usr/local/virtualizor/sdk/admin.php');

    $key =  'your_api_key';
    $pass = 'your_api_pass';
    $ip = 'your_server_ip';

    $admin = new Virtualizor_Admin_API($ip, $key, $pass);

    $page = 1;
    $reslen = 10;
    $post= array();
    $post['poolname'] = 'Live IPv6';
    $post['poolgateway'] = '';
    $post['netmask'] = '';
    $post['servers_search'] = '';
    $post['nameserver'] = '';

    $output = $admin->ippool($page, $reslen, $post);

    print_r(json_encode($output));

?>

Output

{
  "title": "IP Pool",
  "ippools": {
    "3": {
      "ippid": "3",
      "ipp_serid": "0",
      "ippool_name": "Live IPv6",
      "gateway": "2607:fa98:30:1::1",
      "netmask": "64",
      "ns1": "2001:4860:4860::8888",
      "ns2": "2001:4860:4860::8844",
      "ipv6": "1",
      "nat": "0",
      "nat_name": "",
      "routing": "1",
      "internal": "0",
      "bridge": "",
      "mtu": "0",
      "vlan": "0",
      "totalip": "50",
      "freeip": "45"
    }
  },
  "timenow": 1535385866,
  "time_taken": "0.229"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list