ehsan-dashboards/dashboards/search_bulk_update.py

12 lines
520 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/repository/tree?recursive=true&per_page=100&ref=dev', headers=headers)
files = r.json()
print("total files:", len(files))
# Let's search via gitlab search API for 'elasticBulkUpdate'
r_search = requests.get('https://gitlab.ekeepa.co/api/v4/projects/10/search?scope=blobs&search=elasticBulkUpdate', headers=headers)
print("search results:", r_search.json())