- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
How to get all subnets without provide the subnet address and how get the subnet(s) last update?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-08-2015 10:54 PM
Hi All,
I am trying to get all subnets via infoblox api, While it need to provide the subnets' address. For example
POST /wapi/v1.2/network?network=10.10.0.0/12
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?
Many Thanks,
Kent
Listing All Networks
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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:
https://172.16.2.2/wapi/v1.2/network
Or in your script, just do:
POST /wapi/v1.2/network
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+)
https://172.16.2.2/wapi/v1.5/network?_paging=1&_return_as_object=1&_max_results=500
this returns 500 items, plus a long next_page_id string which you would put in the next request, to get 500 more:
https://172.16.2.2/wapi/v1.5/network?_page_id=<next_page_id string>
Version 1.5 did not work
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
08-25-2015 07:12 PM
Try to use version 15 but it response 400 Bad request and "Version 1.5 not supported"
Try an earlier WAPI version
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.)
Re: Listing All Networks
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
05-15-2018 09:16 AM
Hello MRichard,
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,
Georgios Zervakis