Reply

Can't find objects by ip_address

Techie
Posts: 14
5095     0

Hi experts,

I am very new to Infoblox API.. I ran into this problem that when I search for an IP address, I am getting a "network not found" error...

 

curl -X GET -k -H 'Authorization: Basic xxxxx=' -i 'https://1.2.3.4/wapi/v2.11/ipv4address?ip_address=10.146.128.144'

 

 

{ "Error": "AdmConDataError: None (IBDataError: IB.Data:A network was not found for this address.)", 
"code": "Client.Ibap.Data", 
"text": "A network was not found for this address."
}

 

However, in the GUI, the search in the top right corner would return some results.. Please see the attached picture.

2021-04-13 09_32_54-Infoblox Grid Manager - 8.5.2-409296 (admin) — Mozilla Firefox.png

Where did I do wrong? I also tried to include the view in the URL but was getting the same result but I could be using the wrong syntax.. Please help. thanks!

 

 

 

Re: Can't find objects by ip_address

New Member
Posts: 1
5096     0

You need to ensure that the network and IP you are searching for exist.  Either it does not exist or you have a view/permissions issue.

 

Running the same query against my own instance I get the same result:

 

curl -k1 -u admin:infoblox -X GET 'https://192.168.2.10/wapi/v2.1.5/ipv4address?ip_address=10.146.128.144'
{ "Error": "AdmConDataError: None (IBDataError: IB.Data:A network was not found for this address.)",
"code": "Client.Ibap.Data",
"text": "A network was not found for this address."

 

After adding a 10.146.128.0/24 network and querying again shows the following:

curl -k1 -u admin:infoblox -X GET 'https://192.168.2.10/wapi/v2.10.5/ipv4address?ip_address=10.146.128.144'
[
{
"_ref": "ipv4address/Li5pcHY0X2FkZHJlc3MkMTAuMTQ2LjEyOC4xNDQvMA:10.146.128.144",
"ip_address": "10.146.128.144",
"is_conflict": false,
"mac_address": "",
"names": [],
"network": "10.146.128.0/24",
"network_view": "default",
"objects": [],
"status": "UNUSED",
"types": [],
"usage": []
}

 

I then added a host record and verified it resolves:

dig @192.168.2.10 fakehost.test.local +short
10.146.128.144

 

Running the same query again:

curl -k1 -u admin:infoblox -X GET 'https://192.168.2.10/wapi/v2.10.5/ipv4address?ip_address=10.146.128.144'
[
{
"_ref": "ipv4address/Li5pcHY0X2FkZHJlc3MkMTAuMTQ2LjEyOC4xNDQvMA:10.146.128.144",
"ip_address": "10.146.128.144",
"is_conflict": false,
"mac_address": "",
"names": [
"fakehost.test.local"
],
"network": "10.146.128.0/24",
"network_view": "default",
"objects": [
"record:host/ZG5zLmhvc3QkLl9kZWZhdWx0LmxvY2FsLnRlc3QuZmFrZWhvc3Q:fakehost.test.local/default"
],
"status": "USED",
"types": [
"HOST"
],
"usage": [
"DNS"
]
}
]

 

Re: Can't find objects by ip_address

[ Edited ]
Techie
Posts: 14
5096     0

Hey, thanks for the response! First of all, I have no clue why I can't attach a screenshot here... Instead, here is the link. So basically when I did a search with the magnifying glass icon on the top right corner, I found the IP successfully...

 

https://www.dropbox.com/s/x9fptgqjib0f9i7/2021_04_15_12_50_15_Infoblox_Grid_Manager_8.5.2_409296_dif...

 

However, with the same account, I still can't get a response... I also tried with your API version 2.10.5 but that didn't make a difference. I have different views by the way. Does it change how I would use the API? In the GUI I don't have to select the right view before doing the search.. Thanks!

Re: Can't find objects by ip_address

Adviser
Posts: 181
5096     0

Hi,

 

You are right. Having views do make a difference from the API perspective. You can try the following API call that takes views into account

curl -X GET -k -H 'Authorization: Basic xxxxx=' -i 'https://1.2.3.4/wapi/v2.11/ipv4address?ip_address=10.146.128.144&network_view=<insert-view-name>'

You can also try a generic search like below:

curl -X GET -k -H 'Authorization: Basic xxxxx=' -i 'https://1.2.3.4/wapi/v2.11/search?address=10.0.0.2'

Hope this helps,

Regards,

Krishna Vasudevan

Re: Can't find objects by ip_address

Techie
Posts: 14
5096     0

This is really helpful. Thank you!

Showing results for 
Search instead for 
Did you mean: 

Recommended for You