ehsan-dashboards/dashboards/get_schema.py

12 lines
399 B
Python

import requests
import urllib.parse
gitlab_pat = 'glpat-mJPdjrPiHCTj2NqNZN_m'
headers = {'PRIVATE-TOKEN': gitlab_pat}
fname = 'src/services/v2/site/rooms/[id]/schema.ts'
file_path = urllib.parse.quote(fname, safe='')
url = f'https://gitlab.ekeepa.co/api/v4/projects/10/repository/files/{file_path}/raw?ref=main'
r = requests.get(url, headers=headers)
print("Status:", r.status_code)
print(r.text)