Reply
Highlighted
Accepted Solution

REST API FileOp and FixedAddresses

Authority
Posts: 16
2534     0

Try to automate export, manipulation, import between two Grids several zones and their networks,etc. 

 

Using the FileOp to get CSV files of the different elements.  While I can get networks, DHCP  Ranges and most records, I stuck trying to export the Fixed Addresses.

 

fixedaddress are not included in "allrecords" and while I can manually export, find little to help with FileOp to create the correct "_object": or other fields that works or contains the FixedAddresses.

 

Ideally need to pull the records by network or zone.

 

 

Re: REST API FileOp and FixedAddresses

[ Edited ]
Adviser
Posts: 96
2535     0

As per REST API Admin Guide, use 'fixedaddress'.

 

curl -k -u admin:infoblox -H "Content-Type: application/json" -X POST https://192.168.0.12/wapi/v2.7/fileop?_function=csv_export -d '{"_object": "fixedaddress"}'

 

 

The return value will contain a URL. Use it like:

curl -k -u admin:infoblox -H "Content-Type: applicationforce-download" -X GET <URL-from-prior-REST-Call>

 

 I don't think you can filter for a specific network when doing the file-download. But you can do with the 'normal' RESTCall:

 

curl -k -u admin:infoblox -H 'Content-Type: application/json' -X GET https://192.168.0.12/wapi/v2.7/fixedaddress?network=192.168.32.0

So you could create a script that just has two sesssions open and transfer the objects via direct RESTCalls.

 

 

 

 

Re: REST API FileOp and FixedAddresses

Authority
Posts: 16
2535     0

Thanks.

 

Having a csv_export just makes it easier to re-import onto another grid.

 

As the migration is site-by-site the list of networks can vary.  Also trying to download ALL fixed addresses is slow.

 

But can try and create a script to parse afterwards for only the target networks.

Re: REST API FileOp and FixedAddresses

Adviser
Posts: 100
2535     0

Hi,

 

You can export fixed addresses within a given network using the below WAPI calls.

 

curl -k -u admin:infoblox -H 'content-type: application/json' -X POST "https://grid-master/wapi/v2.7/fileop?_function=csv_export" -d '{"_object": "fixedaddress","network":"2.2.2.0/24"}'

In the above call, replace the value in the network parameter within the JSON body to a value in your environment.

 

This call will give you a URL that can be used to download the file directly, and a token for the download session. 

 

You can download the file using the URL obtained like shown in the following command.

curl -k -u admin:infoblox -H 'content-type: application/force-download' "https://grid-master/http_direct_file_io/req_id-DOWNLOAD-1001/Fixedaddresss.csv" -o "FA.csv"

Remember to remove the stored file using the token obtained in the ouput of step 1

curl -k -u admin:infoblox -H 'content-type: application/json' -X POST "https://grid-master/wapi/v2.7/fileop?_function=downloadcomplete" -d '{"token" : "eJylUMFuwjAMvftH4ELbFNrCbkwd2qQJJJi0o9UmKbPUJlkSEPz9nEnbabcdYjl+z89+ltK6O3p9\nBg7SmhD9RUbrwQmYSzKD7Ud7y6zR6cW70wHaLnZ41AO4EiRif6ExkkEERTKCW8JcuRWcZvrmyN8x\n0qRn4CrYiaqomqouVpus4VCtIZxmFz8yWjP/I0YXHvJcNGVW1pnIyjyVUBGvFnGgUSPZ3OtPJLVo\nD+/718O2XYiiEPmz5c3ZgFchk+HKik0SJ8XZmrX/amJok0iK/XAuCublgc13Z53Hyf1nuhA/yqiN\ntIrMOVVLHvH4sk/p8pcwWZUOJNLN2u3bFo9Pu/SvIMSjE3W6p2gYHEiPKmC0KO3kOv/dtYZ9Mtp3\nDsm4S8Sr9oGsSdiGsT77AjVimUo=\n"}'

 

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