3 years ago
Python SDK
I'm looking at using the Python SDK to add some devices.
https://www.logicmonitor.com/support-files/rest-api-developers-guide/sdks/docs/#api-LM-addDeviceDatasourceInstance
When I go to...
That example is overly descriptive. I was able to do it with this (uses my custom sdk wrapper )
from lm import lm response = lm.add_device_datasource_instance(152,9042,{"displayName":"TESTSDK","wildValue":80})
The body is just a python dictionary, no need for the swagger library to be installed manually.
To get the device id, i did
lm.get_device_list(size=1000)
This is where the 152 came from in my call above.
Once I had the device id, i did:
for ds in lm.get_device_datasource_list(deviceID).items: print(ds.id, ds.data_source_name)
To get the list of datasources and their IDs. This is where the 9042 came from in my call above.