Skip to content

Instantly share code, notes, and snippets.

@mlabbe
Created December 19, 2014 20:06
Show Gist options
  • Save mlabbe/294bb35bf77c6c0548cb to your computer and use it in GitHub Desktop.
Save mlabbe/294bb35bf77c6c0548cb to your computer and use it in GitHub Desktop.
Claypot Event Query API
@claypot_app.get('/event/<product_id:int>/<event_names>')
@claypot_app.get('/event/<product_id:int>/<event_names>/start_date/<start_date>')
@claypot_app.get('/event/<product_id:int>/<event_names>/date_range/<start_date>/<end_date>')
def get_event(product_id, event_names, start_date=None, end_date=None):
"""
break down the values for every key for a list of events
sample usage:
http://localhost/claypot/event/1/hwstats,event2,empty_event/start_date/2014-01-01
would return:
{
"empty_event": {},
"hwstats": {
"cpu": {
"intel": 150,
"amd": 120,
},
"ram": {
"8gb": 150,
"4gb": 120,
}
},
"win": {
"time": {
"5-10": 1030,
"11-15": 720
},
}
}
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment