https://prefect.io logo
Title
a

Andrew Pruchinski

04/05/2023, 1:13 PM
Good Morning prefect. Is it possible to get the latest deployment_id from the API? We are kicking off a flow run externally and are trying to just use the API and not the client. Trying to sift through the API docs and I don't see a way. Appreciate the help!
a

Andrew Pruchinski

04/05/2023, 1:21 PM
In the read deployment endpoint, isn't the deployment id required as a path parameter? I need to retrieve this deployment id
Thank you for the responses! I will look through the source code
a

Andrew Pruchinski

04/05/2023, 1:23 PM
I was looking at that one. Is the
id
in the response the deployment_id i am looking for?
r

redsquare

04/05/2023, 1:24 PM
yeah
a

Andrew Pruchinski

04/05/2023, 1:24 PM
Hell yeah!
hey @redsquare, really appreciate the help here. Thank you!
r

redsquare

04/05/2023, 1:24 PM
no worries
a

Andrew Pruchinski

04/05/2023, 1:57 PM
When using that endpoint, is this the json they are expecting?
json={"flows": {"name": {"any_": ["FLOW_NAME"]}}}
r

redsquare

04/05/2023, 2:02 PM
looks right to me
a

Andrew Pruchinski

04/05/2023, 2:06 PM
Cool thanks for the extra look. It's not pulling the correct one, its returning an empty response so i might be doing something wrong. I'll play around with it. Appreciate the help
r

redsquare

04/05/2023, 2:06 PM
sure you have the corrcet name for the flow
with the slash
a

Andrew Pruchinski

04/05/2023, 2:07 PM
Yup. Printed off each and every deployment that was initially returned
Nope. hahah without the slash. I will try that.
r

redsquare

04/05/2023, 2:08 PM
if you do
prefect deployments ls
in the cli you can see the names it expects
a

Andrew Pruchinski

04/05/2023, 2:09 PM
I get an authorized error when trying that
r

redsquare

04/05/2023, 2:15 PM
have you
prefect cloud login
a

Andrew Pruchinski

04/05/2023, 2:21 PM
Yes. I was originally getting a 401 with an access key for the API and then had to create a service account one. But still getting that error here
r

redsquare

04/05/2023, 2:28 PM
have you set PREFECT_API_KEY - apologies if I am asking stupid questions 🙂
a

Andrew Pruchinski

04/05/2023, 2:31 PM
Yes
and no worries at all. I appreciate the help
r

redsquare

04/05/2023, 2:35 PM
what does
prefect profile use default
do
a

Andrew Pruchinski

04/05/2023, 2:36 PM
Ahhhh!
Error authenticating with Prefect Cloud using profile 'default'
r

redsquare

04/05/2023, 2:38 PM
yeah so the url or key is wrong
a

Andrew Pruchinski

04/05/2023, 2:43 PM
The url is randomly starting on a new line after the last
-
in the CLI, otherwise they are the same
r

redsquare

04/05/2023, 2:53 PM
odd - maybe try
prefect cloud logout
and try again
a

Andrew Pruchinski

04/05/2023, 2:56 PM
No luck with that
r

redsquare

04/05/2023, 3:00 PM
sure you have the correct service account key for the workspace
maybe rotate the api key and try again
a

Andrew Pruchinski

04/05/2023, 3:01 PM
Yeah i will try again
Created a service account admin key with the workspace role of owner and still getting the error
r

redsquare

04/05/2023, 3:09 PM
yeah not sure sorry - one for @Chris Reuter / prefect team I think
👀 1
a

Andrew Pruchinski

04/05/2023, 3:09 PM
Absolutely no worries @redsquare. Thank you for the help here
👍 1
Apologies! I figured it out. I had a version 1 prefect API key out there in my bash profile
😁 1
🙌 1
Removed that and now green lights all around
🔥 1
It isn't Monday anymore hahah is it?
:face_with_peeking_eye: 1