• 0

REST API - Devices associated with DataSources


Go to solution Solved by Sarah Terry,

Question

I'm currently working on a project to validate any configured LM alerts have an associated documentation - our documentation should have the datasource name as part of the title. Furthermore, I need to filter out devices that are not in my team's escalation path/rule. e.x. filter out "dev" environment devices.

  • I'm pulling a list of datasources using the REST API '/setting/datasources' endpoint. 
  • I use a filter to only grab those that match my team's given escalation path/rule.
  • I then pull the datasource properties, specifically the "appliesTo" value in the json response.
  • I'm then converting those values into filters that can be used on the 'getDevices' REST API endpoint

Is there an easier and/or better way to match datasources back to devices? The 'appliesTo' values returned do not use the same structure and naming convention used with the 'getDevices' filters.

 

Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

I'm ashamed I didn't see that sooner. Thank you so much!

12 hours ago, Sarah Terry said:

There is, actually! There is a sub-resource of the datasources resource for associated devices: /setting/datasources/{id}/devices.  I've added it to the documentation here: https://www.logicmonitor.com/support/rest-api-developers-guide/datasources/get-datasources/

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.