Matthew Millendorf
05/10/2021, 5:17 PMKevin Kho
query {
flow (where: {project: {name:{_eq: "testing-tasks"}}, name:{_eq:"snowflake-test"}}){
name
id
project {
id
name
}
}
}
Matthew Millendorf
05/10/2021, 5:23 PMKevin Kho
query = """query {
flow (where: {project: {name:{_eq: "testing-tasks"}}, name:{_eq:"snowflake-test"}}){
name
id
project {
id
name
}
}
}"""
url = '<https://api.prefect.io>'
r = requests.get(url, params={'query': query}, headers={"authorization": "Bearer insert_token_here"})
print(r.status_code)
print(r.text)
Matthew Millendorf
05/10/2021, 6:31 PMBearer <api_key>
<api_key>
Bearer <service account key>
<service account key>
any ideas?Matthew Millendorf
05/10/2021, 6:40 PMKevin Kho
Matthew Millendorf
05/10/2021, 8:11 PMKevin Kho
Matthew Millendorf
05/10/2021, 8:51 PMKevin Kho
Matthew Millendorf
05/10/2021, 8:52 PMKevin Kho
Matthew Millendorf
05/11/2021, 1:54 PMMatthew Millendorf
05/11/2021, 1:59 PM/home:prefect_management matthewmillendorf$ python hello_flow.py
Flow URL: <https://cloud.prefect.io/raptormaps/flow/a39210bb-5598-4cee-ab8b-b9da2f4f0a3a>
└── ID: bb7d1f40-7203-4c6f-918e-18bae14b0081
└── Project: tutorial_matt
└── Labels: ['my-macbook']
403
<!DOCTYPE html><html><head><title>Error Page</title><style type="text/css">html{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:1em}.center-box{margin: 20% auto auto auto;width: 50%;border: 1px solid #dcdcdc;padding: 1em;}
</style><title>Security Violation (403)</title></head></head><body>
<div class="center-box">
<h3><http://api.prefect.io|api.prefect.io> | Access denied (403)</h3>
<h4>Current session has been terminated.</h2>
<p>For further information, do not hesitate to contact us.</p>
<p>Ref: <span id="addr">65.96.168.232</span> <span id="time">1620741471</span></p>
</div></body><script>document.getElementById("time").innerHTML = (new Date()).toISOString()</script>
</html>
Kevin Kho
Kevin Kho
User-Agent
under your headersKevin Kho
{'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"}
Matthew Millendorf
05/11/2021, 4:59 PM403
<!DOCTYPE html><html><head><title>Error Page</title><style type="text/css">html{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:1em}.center-box{margin: 20% auto auto auto;width: 50%;border: 1px solid #dcdcdc;padding: 1em;}
</style><title>Security Violation (403)</title></head></head><body>
<div class="center-box">
<h3><http://api.prefect.io|api.prefect.io> | Access denied (403)</h3>
<h4>Current session has been terminated.</h2>
<p>For further information, do not hesitate to contact us.</p>
<p>Ref: <span id="addr">65.96.168.232</span> <span id="time">1620752288</span></p>
</div></body><script>document.getElementById("time").innerHTML = (new Date()).toISOString()</script>
</html>
Code:
r = requests.get(url, params={'query': query}, headers={"authorization": "Bearer <my token>",
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36'})
Kevin Kho
Matthew Millendorf
05/11/2021, 5:52 PMself.logger = prefect.context.get("logger")
does something need to change perhaps? so weird it works locallyMatthew Millendorf
05/11/2021, 5:54 PMTyler Wanner
05/11/2021, 5:54 PMMatthew Millendorf
05/11/2021, 5:57 PMTyler Wanner
05/11/2021, 5:57 PMself.logger
and not logger
Matthew Millendorf
05/11/2021, 5:58 PMMatthew Millendorf
05/11/2021, 5:59 PMKevin Kho
Matthew Millendorf
05/11/2021, 6:01 PMMatthew Millendorf
05/11/2021, 6:01 PMMatthew Millendorf
05/11/2021, 6:01 PMKevin Kho
Matthew Millendorf
05/11/2021, 6:01 PMMatthew Millendorf
05/11/2021, 6:01 PMKevin Kho
Kevin Kho
Matthew Millendorf
05/11/2021, 6:21 PMMatthew Millendorf
05/11/2021, 6:34 PMKevin Kho
Matthew Millendorf
05/11/2021, 6:35 PMMatthew Millendorf
05/11/2021, 7:12 PMTyler Wanner
05/11/2021, 7:25 PMTyler Wanner
05/11/2021, 7:30 PMKevin Kho
Kevin Kho
Matthew Millendorf
05/12/2021, 2:55 PMMatthew Millendorf
05/12/2021, 2:55 PMTyler Wanner
05/12/2021, 2:55 PM