CO - object registry/service

community
Steve L. Nyemba 7 years ago
parent efd7b16a9e
commit 74c613d06e

@ -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)

Loading…
Cancel
Save