File: get_jobs.py

package info (click to toggle)
yade 2025.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,308 kB
  • sloc: cpp: 93,298; python: 50,409; sh: 577; makefile: 162
file content (13 lines) | stat: -rwxr-xr-x 337 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env python3

from urllib.request import Request, urlopen
import json

url = 'https://gitlab.com/api/v4/projects/10133144/jobs/?scope[]=success'
req = Request(url)
req.add_header('PRIVATE-TOKEN', 'XXXXX')
resp = urlopen(req)
content = urlopen(req).read()

j = json.loads(content.decode("utf-8"))
print(json.dumps(j, indent=2))