ehsan-dashboards/dashboards/search_path_query.py

11 lines
365 B
Python

import requests
gitlab_pat = 'glpat-mJPdjrPiHCTj2NqNZN_m'
headers = {'PRIVATE-TOKEN': gitlab_pat}
r_search = requests.get('https://gitlab.ekeepa.co/api/v4/projects/10/search?scope=blobs&search=pathQuery&ref=dev', headers=headers)
results = r_search.json()
print("Count:", len(results))
for item in results[:5]:
print(item['filename'])
print(item['data'])