Hi Shaun,
There is not a CSV importer for event detectors / handlers yet, so you'll have to find another method if you wish to do bulk. Here's a little Python script like those I use for this kind of thing, where I'll be taking a CSV as the input. It'll also require the data points to exist, then navigating to the System Settings page and doing a configuration backup, such that we have the latest JSON to work with (or you can export just the dataPoints from the export page, if you're only trying to work with point detectors).
import json
from StringIO import StringIO
configFile = open("/path/to/Mango/backup/Mango-Configuration.json")
config = json.load(configFile)
configFile.close()
baseLowLimitEventDetector = """{
"xid":"%(eventDetectorXid)s",
"type":"LOW_LIMIT",
"alarmLevel":"URGENT",
"limit":%(limit)s,
"durationType":"SECONDS",
"duration":0,
"notLower":false,
"alias":"%(alias)s"
}"""
dpXidDict = {}
for dp in config["dataPoints"] :
dpXidDict[dp["xid"]] = dp
csvConfigFile = open("/path/to/csvFile.csv")
#if it had headers, you could build a headerDict or disregard the first row.
csvConfigFile.readline() #just consume headers line, assume positions are known.
#let's assume it's comma delimited, there are no loose commas
#alias = index 7, eventDectectorXid = index 8, limit = index 9, dpxid = index 1
for line in csvConfigFile :
data = line.split(",")
if data[7] != "" and data[1] in dpXidDict :
#the dpXidDict holds references to the config's objects, so changes there will be reflected in config, we can use a formatting string to transform our CSV into JSON, then load the json and append the object
dpXidDict[data[1]]["eventDetectors"].append( json.load( StringIO( baseLowLimitEventDetector % { "eventDetectorXid": data[8], "limit":data[9], "alias":data[7] } ) ) )
csvConfigFile.close()
#write our new JSON out
outputFile = open("/path/to/output/Adding-point-detectors.json", "w+")
outputFile.write( json.dumps( config, sort_keys=False, indent=4, separators=(",", ": ") ) )
outputFile.close()
I didn't test this much or check if I had a syntax error or anything, but that's the gist of a method to speed along that process.