ehsan-dashboards/dashboards/get_elastic_service.py

12 lines
505 B
Python

import requests
import urllib.parse
gitlab_pat = 'glpat-mJPdjrPiHCTj2NqNZN_m'
headers = {'PRIVATE-TOKEN': gitlab_pat}
for p in ['src/services/v2/site/elastic/service.GET.ts', 'src/services/v2/site/elastic/service.POST.ts', 'src/models/helper/elastic/update.ts']:
file_path = urllib.parse.quote(p, 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(f"=== {p} ===")
print(r.text[:1500])