Skip to main content
Question

List Cancelled/Failed jobs - VIA Rest API


Is there a way to extract a JSON list of the jobs that have been canceled or failed? I can only really see a list for jobs that are either queued, running or completed? Ideally this would be great if this could be accessed via the REST API

5 replies

david_r
Celebrity
  • March 12, 2018

I believe you'll have to do that in two stages:

First get all the job IDs of all completed jobs:

GET /transformations/jobs/completed

Then loop over all the completed jobs to get the job status for each job id:

GET /transformations/jobs/id/<jobid>/result


Forum|alt.badge.img

Hi @ryanslevin0, 

In FME Server 2018.0 you can list all failed or succeeded jobs with a single call using the completedState query parameter:

GET /transformations/jobs/completed?completedState=failed

GET /transformations/jobs/completed?completedState=success

@david_r's solution is correct for all older versions of FME Server using the REST API v3.


david_r
Celebrity
  • March 12, 2018
gerhardatsafe wrote:

Hi @ryanslevin0, 

In FME Server 2018.0 you can list all failed or succeeded jobs with a single call using the completedState query parameter:

GET /transformations/jobs/completed?completedState=failed

GET /transformations/jobs/completed?completedState=success

@david_r's solution is correct for all older versions of FME Server using the REST API v3.

That's a great improvement!

gerhardatsafe wrote:

Hi @ryanslevin0, 

In FME Server 2018.0 you can list all failed or succeeded jobs with a single call using the completedState query parameter:

GET /transformations/jobs/completed?completedState=failed

GET /transformations/jobs/completed?completedState=success

@david_r's solution is correct for all older versions of FME Server using the REST API v3.

Thanks Gerhard, unfortunatly wer are using FME Server 2017 (though still using REST API v3), so using the URL doesnt seem to be making much difference

 

 

Is there a way to flag if the job has been Cancelled? We have a few jobs that are force canceled if they run to long, it seems there isnt anyway to flag a Cancelled job, only if its Failed or Completed...

 

 


david_r
Celebrity
  • March 13, 2018
ryanslevin0 wrote:
Thanks Gerhard, unfortunatly wer are using FME Server 2017 (though still using REST API v3), so using the URL doesnt seem to be making much difference

 

 

Is there a way to flag if the job has been Cancelled? We have a few jobs that are force canceled if they run to long, it seems there isnt anyway to flag a Cancelled job, only if its Failed or Completed...

 

 

In FME 2017 you can check if a job was cancelled by testing for status = 'ABORTED' in the response after calling the job status request, see my post below.

 

See also the documentation.

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings