Infoblox’s global team of threat hunters uncovers a DNS operation with the ability to bypass traditional security measures and control the Great Firewall of China. Read about “Muddling Meerkat” and the many other threat actors discovered by Infoblox Threat Intel here.

API Examples


WAPI (Web API) Sample Code for NIOS

[ Edited ]
Posts: 21
4879     0

Sample code showing how to use the WAPI (Web API) for NIOS in various languages. These samples include Java, Python and Javascript. 

9/17 - these examples have recently been reviewed and are still current.  If you have specific questions please let us know.

It's nice when...

Not applicable
Posts: 3
4879     0

A multimillion dollar setup has old outdated API docs and examples. Where's 1.7.1?

Re: WAPI (Web API) Sample Code for NIOS

Posts: 26
4879     0

I'm using python 3 and am attempting to use the WAPI to do a couple of things that appear to be beyond its capabilities.


1) Set a vendor-option-space for a subnet:


ISC dhcpd.conf:

subnet netmask {
  option routers;
  option subnet-mask;
  option domain-name-servers,;
  option broadcast-address;
  default-lease-time 864000;
  max-lease-time 864000;
  boot-unknown-clients true;
  vendor-option-space CAPWAP;
  option CAPWAP.controller,,

2) via WAPI, using the same config abive, set boot-unknown-clients to true


3) via WAPI, set the allow/deny known/unclient client flags for a subnet or a range


4) Using the WAPi, retrieve all of the various settings for an object and not just check to see if it exists or not.


5) By some automated means, preferably WAPI, import one or more ISC dhcpd.leases file into a grid


Anybody done this before?



Re: WAPI (Web API) Sample Code for NIOS (JAVA)

New Member
Posts: 1
4879     0



I am trying to use the JAVA libraries to create a host with the following data:

- next available ip

- configure for dhcp enabled


I forked my own method and tried to convert it to add a host, but I keep getting error:

"Error": "AdmConProtoError: List value expected for field: ipv4addrs",   "code": "Client.Ibap.Proto",   "text": "List value expected for field: ipv4addrs"


This is the class I built:


     * Perform some operations with Hosts with JSON.


     * @param port


    public static void hostJSON(WapiPort port) {

        IWapiDAO<JSONObject, JSONObject> network = new WapiDAO<JSONObject, JSONObject>(

                port, "record:host", JSONObject.class, JSONObject.class); //$NON-NLS-1$

        try {

            JSONObject object = new JSONObject();

            object.put("ipv4addrs", ""); //$NON-NLS-1$ //$NON-NLS-2$

            object.put("ipv4addr","func:nextavailableip:"); //$NON-NLS-1$ //$NON-NLS-2$

            object.put("configure_for_dhcp","true"); //$NON-NLS-1$ //$NON-NLS-2$

            object.put("mac","aa:bb:cc:41:22:31"); //$NON-NLS-1$ //$NON-NLS-2$

            object.put("name",""); //$NON-NLS-1$ //$NON-NLS-2$


            String ref = network.create(object);



        } catch (JSONException e) {

            logger.error("An exception occurred when creating JSON", e); //$NON-NLS-1$

            throw new RuntimeException(e);




Can someone please put me in the right direction? or at least head me to a guid how to use these libraries?





Re: WAPI (Web API) Sample Code for NIOS

[ Edited ]
New Member
Posts: 1
4879     0

For the javascript sample, I don't see any configuration to put Infoblox IP address or URL, username, password etc.

Can anyone help to get that information from Javascript script, please?



Re: WAPI (Web API) Sample Code for NIOS

Posts: 26
4879     0

Where's python 3?

Showing results for 
Search instead for 
Did you mean: 

Recommended for You