-
Type:
Incident report
-
Resolution: Won't fix
-
Priority:
Major
-
None
-
Affects Version/s: 1.8
-
Component/s: API (A)
-
None
-
Environment:Linux
I have a proxy whose name I know, and I'd like to retrieve its ID via the API so that later I can associate some hosts that I'm creating via the API with the proxy.
When I use host.getobjects, setting host='myproxyname', it returns an empty array. When I look at the mysql query log, I see that it successfully found the ID, and then called 'get' internally to fill in the details. In that get, it assumes we're looking for a monitored/unmonitored host, so it excludes the proxy from the results.
When I call host.get, passing in host='myproxyname' and proxy_hosts=1, it returns an empty array. When I look at the msql query log, I see that it failed because it tried to join tot he host_groups table, I assume to check permissions, but there is no host_group for a proxy.
I was able to get around this temporarily by setting my api user's type to be superadmin, since that bypasses the permission check, but this doesn't seem like I good idea.