Created
December 19, 2021 16:24
-
-
Save anna-geller/23ef8bbf5bc3d3da78c5329e6f69027f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import requests | |
API_KEY = os.environ["API_KEY"] | |
FLOW_VERSION_GROUP_ID = os.environ["FLOW_VERSION_GROUP_ID"] | |
create_mutation = """ | |
mutation($input: createFlowRunInput!){ | |
createFlowRun(input: $input){ | |
flow_run{ | |
id | |
} | |
} | |
} | |
""" | |
inputs = dict(versionGroupId=FLOW_VERSION_GROUP_ID, parameters=dict(x=6)) | |
response = requests.post( | |
url="https://api.prefect.io", | |
json=dict(query=create_mutation, variables=dict(input=inputs)), | |
headers=dict(authorization=f"Bearer {API_KEY}"), | |
) | |
print(response.status_code) | |
print(response.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment