Jonah
04/24/2023, 10:11 PMAttributeError: 'Depends' object has no attribute 'session_context'
Serina
04/25/2023, 4:21 PMimport requests
PREFECT_API_URL='<https://api.prefect.cloud/api/accounts/abc/workspaces/xyz>'
PREFECT_API_KEY="pnu_defghi"
headers = {"Authorization": f"Bearer {PREFECT_API_KEY}"}
endpoint = f"{PREFECT_API_URL}/ui/flow_runs/history"
response = <http://requests.post|requests.post>(url=endpoint, headers=headers)
print(response.status_code)
json = response.json()
print(json)
Serina
04/25/2023, 4:23 PMimport requests
PREFECT_API_URL='<https://api.prefect.cloud/api/accounts/abc/workspaces/xyz>'
PREFECT_API_KEY="pnu_defghi"
headers = {"Authorization": f"Bearer {PREFECT_API_KEY}"}
endpoint = f"{PREFECT_API_URL}/task_runs/history"
payload = {
"history_start": "2021-04-20T00:00:00+00:00",
"history_end": "2021-04-25T00:00:00+00:00",
"history_interval_seconds": 86400,
}
response = <http://requests.post|requests.post>(endpoint, headers=headers, json=payload)
print(response.status_code)
json = response.json()
print(json)
Serina
04/25/2023, 4:57 PMJonah
04/25/2023, 5:00 PMSerina
04/25/2023, 5:03 PMJonah
04/25/2023, 5:06 PM<https://api.prefect.cloud/api/accounts/270a9520-6cbd-4661-bab3-69a820b40820/workspace/f5171a9d-3e51-47b9-821b-7664eb56631f/ui/flow_runs/history>
Serina
04/25/2023, 5:33 PMimport requests
PREFECT_API_URL='<https://api.prefect.cloud/api/accounts/abc/workspaces/xyz>'
PREFECT_API_KEY="pnu_ghijk"
headers = {"Authorization": f"Bearer {PREFECT_API_KEY}"}
endpoint = f"{PREFECT_API_URL}/health"
response = requests.get(url=endpoint, headers=headers)
print(response.status_code)
json = response.json()
print(json)
Jonah
04/25/2023, 7:42 PMSerina
04/25/2023, 7:43 PM