Skip to content

Instantly share code, notes, and snippets.

@fno2010
Last active September 11, 2017 15:37
Show Gist options
  • Save fno2010/a7f851ec85ba56707de9b280af585ecb to your computer and use it in GitHub Desktop.
Save fno2010/a7f851ec85ba56707de9b280af585ecb to your computer and use it in GitHub Desktop.
Some utility scripts for CMS dashboard: http://dashb-cms-job.cern.ch/dashboard
#!/bin/bash
curl -sSL -H 'Accept: application/json' -H 'Accept-Encoding: gzip' \
http://dashb-cms-job.cern.ch/dashboard/request.py/fileaccessinfo2?$(./getparams $1) \
| gzip -d
#!/usr/bin/env python
import sys
import json
if sys.version[0] == 2:
from urllib import urlencode
else:
from urllib.parse import urlencode
if __name__ == '__main__':
if len(sys.argv) < 2:
sys.stdout.write('%s <json_file>' % sys.argv[0])
sys.exit()
with open(sys.argv[1]) as f:
sys.stdout.write(urlencode(json.load(f)))
{
"schedulerJobId": "https://glidein.cern.ch/145/170907:180836:eno:crab:Data:analysis-scenario4-step3-HcalEcalSiPM:aged-Method2-modified_0"
}
#!/bin/bash
curl -sSL -H 'Accept: application/json' -H 'Accept-Encoding: gzip' \
http://dashb-cms-job.cern.ch/dashboard/request.py/antasktable?$(./getparams $1) \
| gzip -d
#!/bin/bash
curl -sSL -H 'Accept: application/json' -H 'Accept-Encoding: gzip' \
http://dashb-cms-job.cern.ch/dashboard/request.py/listusers-api \
| gzip -d
{
"user": "ANASTASIA GREBENYUK agrebeny@ulb.ac.be",
"task": "",
"from": "",
"to": "",
"timerange": "lastWeek",
"pattern": ""
}
{
"taskname": "170907_180836:eno_crab_Data_analysis-scenario4-step3-HcalEcalSiPM_aged-Method2-modified",
"what": "",
"site": ""
}

Get the list of users

./listusers | jq .

Get the list of tasks submitted by a user

# From the user list above, you can get user names
# Modify the query parameters in params.json file
./listtask params.json | jq .

Get the list of jobs split from a task

# From the task list above, you can get task names
# Modify the task parameters in taskname.json file
./listtask taskname.json | jq.

Get accessed file info of a job

# From the job list above, you can get schedulerJobId of each job
# Modify the job parameters in jobinfo.json file
./getfileinfo jobinfo.json | jq.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment