No instances on API response
Hello everyone,
Sorry if this is a repeat topic here, but I'm having some trouble polling data from our new LogicMonitor setup via API.
As I understand it, I'll need device ID, device datasource ID, instance ID, all together to get graph data over a specific time period. I can successfully pull the first two (device id and datasource id), but when I pull the instances resource, I'm not getting any response.
Example resource path:
/device/devices/{device id}/devicedatasources/{datasourceid}/instances
The response I get is:
{
"total": 0,
"items": [],
"searchId": null,
"isMin": false
}
indicating that there's no instances. This is where I seem to get stuck, I don't seem to be able to move on any further. Has anybody run into this, and can give me a direction for next steps? Anything is appreciated!
Lewis_Beard
·1 year agoI dont usually get my instances that way, so apologies if I'm about to be confusing. :) But I think you are using this call: "/device/devices/{deviceId}/devicedatasources/{hdsId}/instances". I dont think that hdsId is the global template datasource id. In your post you mention "device datasource ID" in your text but then make a reference to {datasourceid} and they arent the same.
If you already knew that, apologies. Anyway, what I usually do is slightly different. I do:
So TL;DR I just wanted to be sure you know that for some of these calls, the "datasource id" isnt necessarily the number you'd see when editing the datasource. Apologies if I just focused in on the wrong thing in your post.
Maybe I'll just focus on something where I have some target devices in a Map and I'm snagging the actual instances of a specific logicmodule to roll up into something else I'm doing. Its a different way to get to the data, and I have some function calls here that I dont show but hopefully are clear.
If this muddies the water, I apologize. I'm just hoping it will help, since so many people here have helped me.
Feel free to ignore me and just open a support ticket. :)
juramir
OP1 year agoThanks a bunch for your reply! I checked it out today and it looks like I haven't been running into any issues. I think I got stuck in the "hierarchical" structure that I expected (Device -> Datasource -> instance) and it looks like I completely missed over that endpoint.
I've now tested on several devices and ports (instances) and not seeing any issues so far.
jake_nahm
·1 year agoThanks juramir. Definitely worth raising a support ticket for this case. Based on the information provided it seems like you should be getting a response.