Forum Discussion
Joe_Williams
2 years agoProfessor
The way we have done it is we have a script that loops through and creates the instances. We can’t go with the way Stuart does as we need to create instance level properties as well to pass on in alerting. You get your device id, device datasource id, then a simple loops.
datasourceinstancespath = "/device/devices/" + deviceid + "/devicedatasources/" + devicedatasourceid + "/instances"
with open('CLIENTPingOnly.csv', newline='', encoding='utf-8-sig') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
print(row['wildValue'])
targetbody = json.dumps({
"wildValue": row['wildValue'],
"displayName": row['displayName'],
"customProperties": [{"name": "sn.sys_id", "value": row['customProperties']}]
})
addinstance = lm_rest("POST", datasourceinstancespath, targetbody, "")
Related Content
- 4 years ago