Bug fix with API endpoints

community
Steve L. Nyemba 8 years ago
parent bb050b0e6b
commit 99c3cbb2e6

File diff suppressed because one or more lines are too long

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

Loading…
Cancel
Save