Learn How We Can Help You Keep Teleworkers Protected During the COVID-19 Crisis

API & Integration

Reply
Highlighted

WAPI call pull all network and some extattrs?

[ Edited ]
Authority
Posts: 34
74     0

I have been trying to do this myself but after beating myself up I'm "phoning a friend"

 

GOAL:

Utilize a curl call to pull all networks and include just some extensible attributes (UN-LOCODE, SubnetName, VLANdescrip)

 

What do I have so far?

I can pull all networks using this command:

curl --tlsv1 --insecure --user 'admin:infoblox' 'https://ddi.domain.corp/wapi/v2.5/network?_max_results=5000'
What I can't do is put that into a CSV file so I am cheating with just showing networks by running an ugly command like this
curl --tlsv1 --insecure --user 'admin:infoblox' 'https://ddi.domain.corp/wapi/v2.5/network?_max_results=5000' 2>&1 | grep '"network":' > output.txt
 
ISSUE: doesn't include the extensible attributes but I can grab all extensible attributes by using this command
curl --tlsv1 --insecure --user 'admin:infoblox' 'https://ddi.domain.corp/wapi/v2.11/network?_max_results=50005&_return_fields=network,extattrs'
This pulls ALL extensible attributes and not just UN-LOCODE, SubnetName, VLANdescrip and the output is ugly.
 
Was hoping someone has done this and could help me understand how to do this call to include just
  • network
  • extattrs: UN-LOCODE
  • extattrs: SubnetName
  • extattrs: VLANdescrip
 
EXTRA CREDIT:
Anyone output all information for all networks into a php or html file in table format that someone could download into CSV.  Our customers always want a list of the most up to date networks in our environment and to have the ability to put this up on a webpage and make it searchable, downloadable/export to CSV, sortable would be exactly what the doctor/customer ordered.  I would make the command run via cron and always have it available to anyone who has the link.
Highlighted

Re: WAPI call pull all network and some extattrs?

Community Manager
Community Manager
Posts: 184
75     0

You will always get all the extensible attributes when you ask for them.  You would need to filter them client-side side if you don't want to use them all.

Showing results for 
Search instead for 
Do you mean 

Recommended for You

Businesses are investing heavily into securing company resources from cyber-attacks form cybercrimin