-
Notifications
You must be signed in to change notification settings - Fork 1
/
humio.py
32 lines (27 loc) · 1.53 KB
/
humio.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from core import plugin, model
from plugins.humio.models import trigger
class _humio(plugin._plugin):
version = 2.0
def install(self):
# Register models
model.registerModel("humio","_humio","_trigger","plugins.humio.models.trigger")
model.registerModel("humioIngest","_humioIngest","_trigger","plugins.humio.models.action")
model.registerModel("humioSearch","_humioSearch","_action","plugins.humio.models.action")
model.registerModel("humioDashboard","_humioDashboard","_action","plugins.humio.models.action")
return True
def uninstall(self):
# deregister models
model.deregisterModel("humio","_humio","_trigger","plugins.humio.models.trigger")
model.deregisterModel("humioIngest","_humioIngest","_action","plugins.humio.models.action")
model.deregisterModel("humioSearch","_humioSearch","_action","plugins.humio.models.action")
model.deregisterModel("humioDashboard","_humioDashboard","_action","plugins.humio.models.action")
return True
def upgrade(self,LatestPluginVersion):
#Added Humio Dashboard Action
if self.version < 1.5:
model.registerModel("humioDashboard","_humioDashboard","_action","plugins.humio.models.action")
model.registerModel("humioSearch","_humioSearch","_action","plugins.humio.models.action")
#Added Humio Ingest Action
if self.version < 1.2:
model.registerModel("humioIngest","_humioIngest","_action","plugins.humio.models.action")
return True