Skip to content

Instantly share code, notes, and snippets.

@anna-geller
Created December 19, 2021 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anna-geller/23ef8bbf5bc3d3da78c5329e6f69027f to your computer and use it in GitHub Desktop.
Save anna-geller/23ef8bbf5bc3d3da78c5329e6f69027f to your computer and use it in GitHub Desktop.
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