2 years ago
Datasource SDT and REST API
I’d like to write a script to accomplish what we can do in the GUI when creating a new SDT, which is to find a datasource and create a global SDT applied to it. The REST API v3 shows me that we can ...
You can first find the group id (Folder) https://www.logicmonitor.com/swagger-ui-master/dist/#/Device%20Groups/getDeviceGroupList
Then once you have the group id use this to list all the data sources in the group https://www.logicmonitor.com/swagger-ui-master/dist/#/Device%20Groups/getDeviceGroupDatasourceList
Once you have that list you then POST to https://www.logicmonitor.com/swagger-ui-master/dist/#/SDTs/addSDT
Example payload:
{"deviceGroupId":1,"type":"ResourceGroupSDT","sdtType":"oneTime","startDateTime":1679192040000,"endDateTime":1679192100000,"timezone":"Australia/Sydney","comment":"","dataSourceId":"581","dataSourceName":".Net CLR Loader(.NetCLRLoader)"}
That will set SDT on every resource in the group