Hi, im having some weird behavior with the API that im unsure how to continue debugging as im not sure if its a bug or not.
What im doing is the following:
Get all computer groups using GET /api/computergroups/<site>
Using the output of 1 get some of the computer group details, GET /api/computergroup/<site>/<id>
Collect the list of computers for each computer group in 1 using GET /api/computergroup/<site>/<id>/computers
Get some of the computer details for each computer in 3 using GET /api/computer/<id> (This does not work for some of the computers returned in the list for 3 and Im not sure where to start looking as to why)
When getting some of the computers in step 4, I get 404 Resource Not Found, even though its clearly listed in the computer groups computer output.
Yea, this isnt the first buggy behavior ive hit either, I had a similar problem with getting fixlet listings for external sites.
We are using 9.1.1117.0 .
I started down the path to writing a relevance query and failed miserably. Im trying to retrieve the computer name, dns name, id, and os for the short term for a computer of a specific id (I was just caching the whole computer XML and extracting from there or at least trying to if it had worked).
I havent used the console for much of anything, ive been mainly work through the API, ill give it a look though since it seems easier than trolling through the doc.
Session relevance is different than the API, but the api/query uses session relevance. The thing I linked above is to help write session relevance against your web reports server using the SOAP api.
Session relevance can be used in many places, including the console, dashboards, wizards, SOAP API, REST API, etc…
I get the same results even with the query (at least for the computer id im having issues with). The query doesnt throw an 404 Not Found like the GET /api/computer/<id> did but instead just returns no result…
I think this may be a bug after all unless it has something to do with the state of the computer/client?
Yes it does work for me, its just not working for specific computer id’s listed in whats returned by /api/computergroup/<site>/<id>/computers. If I ignore the exception im able to process the rest (didnt check how many didnt process though). However on a different lab server (not the production one ive been using for the above), I have a site without about 10 computers listed and its not able to retrieve computer data for any of the listed computer id’s.
[Edit] I figured out the problem, it is definitely a bug in the API most likely. What I am finding is that /api/computergroup/<site>/<id>/computers for a particular computer group G is returning a list of about 73 computer ids. However, when I check that same computer group G in the console, it actually only has 32 servers in it. When I ignore the exceptions for retrieving details for those 73, I actually get back the 32 that are really there.
Using relevance is a great way to get this info;
Just thought I’d ask if you’ve seen my post on powershell api queries, right?
see my post in response to What permissions are needed for REST API GETs?
You can also use try/catch in p/s scripts, of course.