|
@@ -69,11 +69,38 @@ def get_summary(id):
|
|
id='summary/'+id.strip()
|
|
id='summary/'+id.strip()
|
|
print p
|
|
print p
|
|
print id
|
|
print id
|
|
- r = r = gReader.view(id,key=p['uid'])
|
|
|
|
|
|
+ r = gReader.view(id,key=p['uid'])
|
|
|
|
|
|
except Exception,e:
|
|
except Exception,e:
|
|
print (e)
|
|
print (e)
|
|
return json.dumps(r)
|
|
return json.dumps(r)
|
|
|
|
+@app.route("/1/sys/usage/trend")
|
|
|
|
+def get_usage_trend():
|
|
|
|
+ """
|
|
|
|
+ This function returns trends for the 24 most recent observations in the logs
|
|
|
|
+ """
|
|
|
|
+ r = {}
|
|
|
|
+ try:
|
|
|
|
+ gReader = factory.instance(type=class_read,args=p)
|
|
|
|
+ r = gReader.view('summary/resource_usage_trend',key=p['uid'])
|
|
|
|
+ except Exception,e:
|
|
|
|
+ print (e)
|
|
|
|
+ return json.dumps(r)
|
|
|
|
+
|
|
|
|
+@app.route("/1/app/usage/trend")
|
|
|
|
+
|
|
|
|
+def get_usage_detail():
|
|
|
|
+ """
|
|
|
|
+ This function returns trends for the 24 most recent observations in the logs
|
|
|
|
+ """
|
|
|
|
+ r = {}
|
|
|
|
+ try:
|
|
|
|
+ gReader = factory.instance(type=class_read,args=p)
|
|
|
|
+ r = gReader.view('summary/app_resource_usage_details',key=p['uid'])
|
|
|
|
+ except Exception,e:
|
|
|
|
+ print (e)
|
|
|
|
+ return json.dumps(r)
|
|
|
|
+
|
|
@app.route('/get/<id>')
|
|
@app.route('/get/<id>')
|
|
def procs(id):
|
|
def procs(id):
|
|
try:
|
|
try:
|