def ping(): data = request.json data['@timestamp']=getcts() #find city by lan and lon location = 'chennai' es_helper.write_to_es(es,'ping',location,data, data['device_mac']) return jsonify({'status':200})
def push(): data = request.json data['@timestamp']=getcts() print data #find city by lan and lon location = 'chennai' es_helper.write_to_es(es,'data',location,data) res = es_helper.search_by_lat_lon(es,data['location']['lat'],data['location']['lon'],"1km") return jsonify({'status':'200', 'data':res})