Now Available - Forrester's Total Economic Impact study. Discover millions in cost savings, unlock IT efficiency gains, and explore why NIOS DDI is a game changer. Get Your Copy here.

API Examples

Reply

Looking to get a list of all authoriative domains and return all name and ipv4addr values

Techie
Posts: 12
536     1

Can someone help me out with sending an API request to get all domains that are authoritative and then list out the following values:

 

Name of record

type of record

ipv4addr record

 

Is there also a way to pull down the csv file from the GUI via an API call?

Re: Looking to get a list of all authoriative domains and return all name and ipv4addr values

Moderator
Moderator
Posts: 267
536     1

Here is an example for exporting all the authoritative zone objects (not records) from the view called "Internal DNS":


# Start the export job

curl -k1 -u admin:infoblox -X POST \
'https://192.168.1.2/wapi/v2.11/fileop?_function=csv_export' \
-H "Content-Type: application/json" \
-d '{ "_object":"zone_auth","view":"Internal DNS"}'


# returns:

{
    "token": "eJytjk0LgjAAhv+K7Jz7MpfzZlgQREEEHYe4pQN1Nmf0Qf89d6hrl67Pw/vxBOrWa3sXTrcKpAFh\nC0ZZkmAGMZ7TiPBZAEbbTArUzvVDihDhFBKWQA4Z8kxIbVXpxFk3SmiDrLoILcN8f9pt91keYkoi\nHJOIxpxzShOUja5+mE4NsByuYBqQhSuE6kojdVf5qeVm9+Wtkf4ZyLNjJg6r9Ud4hgZnbFEp5Nr+\nT1+09MW/cuD1BvjvXZI=\n", 
    "url": "https://192.168.1.2/http_direct_file_io/req_id-DOWNLOAD-0213051325999228/Authzones.csv"
}

# download file

curl -k1 -u admin:infoblox -H "Content-type:application/force-download" -O \
'https://192.168.1.2/http_direct_file_io/req_id-DOWNLOAD-0213051325999228/Authzones.csv'


# and then close the file using the token

curl -k1 -u admin:infoblox -X POST 'https://192.168.1.2/wapi/v2.11/fileop?_function=downloadcomplete' \
-H "Content-Type: application/json" -d '{ "token": "eJytjk0LgjAAhv+K7Jz7MpfzZlgQREEEHYe4pQN1Nmf0Qf89d6hrl67Pw/vxBOrWa3sXTrcKpAFh\nC0ZZkmAGMZ7TiPBZAEbbTArUzvVDihDhFBKWQA4Z8kxIbVXpxFk3SmiDrLoILcN8f9pt91keYkoi\nHJOIxpxzShOUja5+mE4NsByuYBqQhSuE6kojdVf5qeVm9+Wtkf4ZyLNjJg6r9Ud4hgZnbFEp5Nr+\nT1+09MW/cuD1BvjvXZI=\n"}'

 

To export records, use the "allrecords" synthetic object type.  Note that a zone name is required.  View name is recommended, otherwise the default view is used.

 

curl -k1 -u admin:infoblox -X POST \
'https://192.168.1.2/wapi/v2.11/fileop?_function=csv_export' \
-H "Content-Type: application/json" \
-d '{"_object":"allrecords", "zone":"example.com", "view":"Internal DNS"}'

Then download, and close, the same way as above.

Showing results for 
Search instead for 
Did you mean: 

Recommended for You