mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 16:42:05 +00:00
Fix pagination in lambdas
This commit is contained in:
parent
09eb3b8fc1
commit
00be07b9af
@ -53,12 +53,21 @@ def list_runners(access_token):
|
|||||||
"Authorization": f"token {access_token}",
|
"Authorization": f"token {access_token}",
|
||||||
"Accept": "application/vnd.github.v3+json",
|
"Accept": "application/vnd.github.v3+json",
|
||||||
}
|
}
|
||||||
|
response = requests.get("https://api.github.com/orgs/ClickHouse/actions/runners?per_page=100", headers=headers)
|
||||||
response = requests.get("https://api.github.com/orgs/ClickHouse/actions/runners", headers=headers)
|
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
data = response.json()
|
data = response.json()
|
||||||
print("Total runners", data['total_count'])
|
total_runners = data['total_count']
|
||||||
runners = data['runners']
|
runners = data['runners']
|
||||||
|
|
||||||
|
total_pages = int(total_runners / 100 + 1)
|
||||||
|
print("Total pages", total_pages)
|
||||||
|
for i in range(2, total_pages + 1):
|
||||||
|
response = requests.get(f"https://api.github.com/orgs/ClickHouse/actions/runners?page={i}&per_page=100", headers=headers)
|
||||||
|
response.raise_for_status()
|
||||||
|
data = response.json()
|
||||||
|
runners += data['runners']
|
||||||
|
|
||||||
|
print("Total runners", len(runners))
|
||||||
result = []
|
result = []
|
||||||
for runner in runners:
|
for runner in runners:
|
||||||
tags = [tag['name'] for tag in runner['labels']]
|
tags = [tag['name'] for tag in runner['labels']]
|
||||||
|
@ -49,12 +49,20 @@ def list_runners(access_token):
|
|||||||
"Authorization": f"token {access_token}",
|
"Authorization": f"token {access_token}",
|
||||||
"Accept": "application/vnd.github.v3+json",
|
"Accept": "application/vnd.github.v3+json",
|
||||||
}
|
}
|
||||||
|
response = requests.get("https://api.github.com/orgs/ClickHouse/actions/runners?per_page=100", headers=headers)
|
||||||
response = requests.get("https://api.github.com/orgs/ClickHouse/actions/runners", headers=headers)
|
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
data = response.json()
|
data = response.json()
|
||||||
print("Total runners", data['total_count'])
|
total_runners = data['total_count']
|
||||||
runners = data['runners']
|
runners = data['runners']
|
||||||
|
|
||||||
|
total_pages = int(total_runners / 100 + 1)
|
||||||
|
for i in range(2, total_pages + 1):
|
||||||
|
response = requests.get(f"https://api.github.com/orgs/ClickHouse/actions/runners?page={i}&per_page=100", headers=headers)
|
||||||
|
response.raise_for_status()
|
||||||
|
data = response.json()
|
||||||
|
runners += data['runners']
|
||||||
|
|
||||||
|
print("Total runners", len(runners))
|
||||||
result = []
|
result = []
|
||||||
for runner in runners:
|
for runner in runners:
|
||||||
tags = [tag['name'] for tag in runner['labels']]
|
tags = [tag['name'] for tag in runner['labels']]
|
||||||
|
Loading…
Reference in New Issue
Block a user