03-23-2018 05:38 AM - edited 03-23-2018 05:53 AM
I was hoping to get a little assistance with a small issue I am having. While doing a search for a hostname, the API only returns 2 instances found even when there are 3 or more instances/hosts with the same name in IPAM. I am attempting the automate the retrieval of assigned IP addresses for a specific hostname, but I am not sure why it only returns 2 max. The code is below:
WAPI.open "GET", searchHostURL, false, userName, password
WAPI.setRequestHeader "Content-Type", "application/json; charset=UTF-8"
WAPI.setRequestHeader "CharSet", "charset=UTF-8"
WAPI.setRequestHeader "Accept", "application/json"
Thanks is advanced for any help assistance with this.
Solved! Go to Solution.
03-23-2018 09:42 AM
I just tested this:
curl -k1 -u admin:xxx -H "Content-Type: application/json" -X GET https://10.60.27.4/wapi/v2.5/record:host?name~=a1
I received 4 objects in the response, as expected. I'm not sure why your query wouldn't be returning all matching records, the syntax is correct. The default setting for _max_results is 1000.
03-23-2018 10:13 AM
BRampling, thanks for your quick response. while doing some more troubleshooting I realized that the actual display box was concatenating the returned string. I had to display the results with a different type of box.