- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Can't find objects by ip_address
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2021 08:37 AM
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.
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!
Solved! Go to Solution.
Re: Can't find objects by ip_address
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2021 11:01 AM
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 ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2021 11:52 AM - edited 04-15-2021 11:55 AM
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...
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2021 01:18 AM
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
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2021 10:46 AM
This is really helpful. Thank you!