-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom_store.py
34 lines (31 loc) · 1.02 KB
/
custom_store.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
33
34
################################################################
# @Bevywise.com IOT Initiative. All rights reserved
# www.bevywise.com Email - [email protected]
#
# custom_store.py
#
# The custom data store hook for the Big Data Storage.
# The Custom data hook can be enabled in the broker.conf
# inside conf/ folder.
#
# The parameter data will be in dict format and the keys are 'sender','topic', 'message', 'unixtime', 'timestamp'
#
################################################################
import os, sys, time
sys.path.append(os.getcwd()+'../extensions')
# replace the Elastic installed path with next line
sys.path.append('/usr/local/lib/python2.7/dist-packages')
from Elastic import Elastic
global Elas_inst
confpath = "../extensions/plugin.conf"
Elas_inst = Elastic(confpath)
def handle_Received_Payload(data):
#
# Write your code here. Use your connection object to
#
#
# finish your code here.
#
# Send data to your data store
result = Elas_inst.data_consumer(data)
# if result is none then write failed