1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| import requests username = "" password = "" payload = { 'page': 1, 'page_size': 10, 'policy_id': 1 } api_url = "https://harbor.zhaohongye.com/api/v2.0/replication/executions" r = requests.get(api_url, params=payload, auth=(username,password)) if r.status_code == 200: result_list = [] for i in r.json(): if i['status'] != "Succeed": print('error') print('ok')
|