ehsan-dashboards/dashboards/search_es_client.py

9 lines
377 B
Python

import requests
gitlab_pat = 'glpat-mJPdjrPiHCTj2NqNZN_m'
headers = {'PRIVATE-TOKEN': gitlab_pat}
r = requests.get('https://gitlab.ekeepa.co/api/v4/projects/10/search?scope=blobs&search=elasticsearchClient', headers=headers)
print("Search 'elasticsearchClient':", len(r.json()))
for match in r.json()[:20]:
print(match['filename'], match['path'], match.get('startline'))