Determining if job is suspended with API
Hi, is there a way to determine if a job is in the suspended state using the Windmill API? I've looked at the frontend code and it seems to use
JobService
for this, but that is hidden. Is there also a way to determine what the resume/cancel URLs are for a suspended run?6 Replies
by design only owners can resume flows they do not have the urls of because they didn't receive it
https://app.windmill.dev/openapi.html#tag/job/POST/w/{workspace}/jobs/flow/resume/{id}
and list jobs has a suspended filter: https://app.windmill.dev/openapi.html#tag/job/GET/w/{workspace}/jobs/list
ahhh, yes that makes a bit more sense. If the API caller uses an owner's token is there a way to get these urls? I'm guessing the frontend would do something similar?
no those urls are lost forever if not received
for security reasons
doing it as an owner bypass the needs for the urls
Okay, and the owner is just whoever started the job? I've had a look at the suspended filter to get suspended jobs, but I was wondering if there was an option to determine whether a job was suspended given a specific id (e.g., calling
/w/{workspace}/jobs_u/get/{id}
to get suspended status).no the owner is the owner of the flow which is the folder owner or user if flow is in user space
/w/{workspace}/jobs_u/get/{id}yes this will return you the suspended count I think
I see a
suspend
field in the response, but a suspended job has a value of 0
. I'll have a further look at the output to see if its suspended. Otherwise, I'll just look at how the filter is done
Thanks for your help 🙂
do you know what field this is in? I can't see to find where its shown