diff --git a/src/api/index.py b/src/api/index.py index 6e19647..73b02e1 100644 --- a/src/api/index.py +++ b/src/api/index.py @@ -29,6 +29,7 @@ from utils.workers import ThreadManager, Factory from utils.ml import ML,AnomalyDetection,AnalyzeAnomaly import utils.params as SYS_ARGS import atexit +import pickle app = Flask(__name__) app.config['SECRET_KEY'] = '!h8-[0v8]247-4-360' @@ -229,6 +230,28 @@ def app_status() : #return json.dumps(r) + +@app.route('/init/collector',methods=['POST']) +def InitCollector(): + + r = [] + try: + key = request.headers['key'] + node= request.headers['id'] + scope=request.headers['scope'] if 'scope' in request.headers else {} + # + # @TODO : Validate the account & plan, insure preconditions are met/satisfied + # + m = {'apps':'monitor.DetailProcess','folders':'monitor.FileWatch'} + + for id in scope : + agent = eval(m[id]+"()") + r.append(pickle.dumps(agent)) + + except Exception,e: + print e + return json.dumps(r) + """ This function/endpoint will assess n-virtual environments and return the results @TODO: Should this be stored for future mining (I don't think so but could be wrong)