|
|
|
@ -236,7 +236,7 @@ def get_logs() :
|
|
|
|
|
args = str(json.dumps(p))
|
|
|
|
|
args = json.loads(args)
|
|
|
|
|
args['dbname'] = dbname
|
|
|
|
|
scope = ['app_status','app_resources','folder_size','app_status_details']
|
|
|
|
|
scope = ['app_status','app_resources','folder_info','app_status_details','app_resource_usage_details']
|
|
|
|
|
for id in scope :
|
|
|
|
|
gReader = factory.instance(type=class_read,args=args)
|
|
|
|
|
view = ('summary/'+id).strip()
|
|
|
|
@ -248,7 +248,7 @@ def get_logs() :
|
|
|
|
|
print (e)
|
|
|
|
|
return json.dumps(r)
|
|
|
|
|
|
|
|
|
|
@app.route('/1/get/summary/<id>')
|
|
|
|
|
@app.route('/1/get/logs/<id>')
|
|
|
|
|
def get_summary(id):
|
|
|
|
|
"""
|
|
|
|
|
This function returns the summary i.e an overall assessment of resource usage
|
|
|
|
@ -257,16 +257,20 @@ def get_summary(id):
|
|
|
|
|
"""
|
|
|
|
|
r = []
|
|
|
|
|
try:
|
|
|
|
|
gReader = factory.instance(type=class_read,args=p)
|
|
|
|
|
#if id == 'apps_resources' :
|
|
|
|
|
# r = gReader.view('summary/app_resources',key=p['uid'])
|
|
|
|
|
#else:
|
|
|
|
|
# r = gReader.view('summary/folder_size',key=p['uid'])
|
|
|
|
|
id='summary/'+id.strip()
|
|
|
|
|
print p
|
|
|
|
|
print id
|
|
|
|
|
r = gReader.view(id,key=p['uid'])
|
|
|
|
|
|
|
|
|
|
key = request.headers['key']
|
|
|
|
|
default_plan = CONFIG['plan']
|
|
|
|
|
handler = Register(write=class_write,read=class_read,store=p,default=default_plan,uid=key)
|
|
|
|
|
if handler.is_registered() :
|
|
|
|
|
plan = handler.get_info()
|
|
|
|
|
|
|
|
|
|
args= json.loads(json.dumps(p))
|
|
|
|
|
args['dbname'] = plan['name']
|
|
|
|
|
args['uid'] = key
|
|
|
|
|
|
|
|
|
|
gReader = factory.instance(type=class_read,args=args)
|
|
|
|
|
r = gReader.read()
|
|
|
|
|
r = r[id][len(r[id])-1]
|
|
|
|
|
except Exception,e:
|
|
|
|
|
print (e)
|
|
|
|
|
return json.dumps(r)
|
|
|
|
|