Skip to content

Instantly share code, notes, and snippets.

@fno2010
Last active September 12, 2017 16:20
Show Gist options
  • Save fno2010/a384282195d72775fa1894fe58e6b9f0 to your computer and use it in GitHub Desktop.
Save fno2010/a384282195d72775fa1894fe58e6b9f0 to your computer and use it in GitHub Desktop.
Org mode notebook for CMS dashboard/PhEDEx database query.

Get Parameters

import sys
if sys.version[0] == 2:
    from urllib import urlencode
else:
    from urllib.parse import urlencode

def get_params(params={}):
    return urlencode(params)

List Users

GET http://dashb-cms-job.cern.ch/dashboard/request.py/listusers-api
Accept: application/json

List Tasks

<<get_params>>
return get_params({
    "user": user,
    "task": "",
    "from": "",
    "to": "",
    "timerange": "lastWeek",
    "pattern": ""
})
GET http://dashb-cms-job.cern.ch/dashboard/request.py/antasktable?${params}
Accept: application/json

List Jobs

<<get_params>>
return get_params({
    "taskname": taskname,
    "what": "",
    "site": ""
})
GET http://dashb-cms-job.cern.ch/dashboard/request.py/antasktable?${params}
Accept: application/json

List File Access Information

<<get_params>>
return get_params({
    "schedulerJobId": jobId
})
GET http://dashb-cms-job.cern.ch/dashboard/request.py/fileaccessinfo2?${params}
Accept: application/json
@fno2010
Copy link
Author

fno2010 commented Sep 12, 2017

Use ob-http, you can execute this codeblock by Emacs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment