Reply
Highlighted

How to get all subnets without provide the subnet address and how get the subnet(s) last update?

Techie
Posts: 8
6889     1

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

 

 

Highlighted

Listing All Networks

Community Manager
Community Manager
Posts: 187
6889     1

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>

Highlighted

Version 1.5 did not work

Techie
Posts: 8
6889     1

Try to use version 15 but it response 400 Bad request and "Version 1.5 not supported"

 

Highlighted

Try an earlier WAPI version

Adviser
Posts: 135
6889     1

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.)

Highlighted

Re: Listing All Networks

Techie
Posts: 1
6890     1

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

https://x.x.x.x/wapi/v1.6/network?_max_results=50005&_return_fields=comment,disable,members,enable_d...

 

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

 

Showing results for 
Search instead for 
Did you mean: 

Recommended for You