06-08-2015 10:54 PM
I am trying to get all subnets via infoblox api, While it need to provide the subnets' address. For example
So I need to create a cofig file and put all the network address (10.0.0.0/12) in it and get all the subnets. But when server have update the network set,for example, add a network address, I need to update my config file also, this is wired. cause I may do not know which network address has been added.
1, Is there a way to get all subnets without provide the subnet address?
2, if question 1 is not easy to solve, Is there a smart way to know which subnet has been added automatically via api?
06-12-2015 03:43 AM
Try issuing the request without specifying a network to search for. For example, you can put this in a web browser to display them all to your browser screen:
Or in your script, just do:
If there are over 1000 items to return, you will get an error, because you need "page" through them all, by grabbing a set of 500 or so at a time: (needs API version 1.5+)
this returns 500 items, plus a long next_page_id string which you would put in the next request, to get 500 more:
08-26-2015 07:07 AM
If you get an error message "Version 1.5 not supported" that probably means that your version of NIOS is earlier than 6.11. (6.11 LD = WAPI 1.5, while 6.11 = WAPI 1.6.) A command like the following one will work in all WAPI versions from 1.0 forward:
curl --tlsv1 --insecure --user 'admin:infoblox' 'https://gm.example.com/wapi/v1.0/network?_max_results=5000'
(Change the value of
_max_results to be larger than the number of networks you have.)
05-15-2018 09:16 AM
It has been a long time since you wrote this answer but I would like to ask you something regarding to it. I was able to follow your advise and export all of my business subnets. However, I realised that some of them are missing and I cannot understand the reason for that. I followed two processes, to extract everything at once
I also extracted them 500 each time. The final result is the same following both approaches. However, some subnets are missing.
I also tried to export a csv file from the GUI, but the extracted excel file consists of only 350 subnets. Extracting them using the cURL, they are 8500. The difference is huge and I cannot understand why I cannot extrct all of them from the GUI. (yes, I am selecting the all of them and not only the first page)
Could you provide some guidance on how to verify that I have extracted all my subnets?
Thank you in advance,