Is there a way from the rest API to check what jobs are currently running? I have my users submitting jobs to run asynchronously and I would like to make sure that job isn't already running before they try and submit. Is there a way to see when a job was last run?
Retrieve all running jobs:
GET /transformations/jobs/running
If you have the job id from the last run, you can see when it finished:
GET /transformations/jobs/id/<jobid>/result
If you don't have the job id, query all finished and/or queued jobs to look for your workspace filtering on the request.workspacePath reponse (you will have to request detail=high):
GET /transformations/jobs/queued
GET /transformations/jobs/finished
Retrieve all running jobs:
GET /transformations/jobs/running
If you have the job id from the last run, you can see when it finished:
GET /transformations/jobs/id/<jobid>/result
If you don't have the job id, query all finished and/or queued jobs to look for your workspace filtering on the request.workspacePath reponse (you will have to request detail=high):
GET /transformations/jobs/queued
GET /transformations/jobs/finished
Thanks for providing them, is there a resource you used to discover these calls? I could not find them in the documentation. (http://playground.fmeserver.com/using-the-rest-api)
It's a shame these calls are not included in the Javascript library. It should be trivial enough for me to customise the library and add them myself though.
Retrieve all running jobs:
GET /transformations/jobs/running
If you have the job id from the last run, you can see when it finished:
GET /transformations/jobs/id/<jobid>/result
If you don't have the job id, query all finished and/or queued jobs to look for your workspace filtering on the request.workspacePath reponse (you will have to request detail=high):
GET /transformations/jobs/queued
GET /transformations/jobs/finished
The call for finished jobs seems to be;
GET /transformations/jobs/completed
Found through trial and error.
Thanks for providing them, is there a resource you used to discover these calls? I could not find them in the documentation. (http://playground.fmeserver.com/using-the-rest-api)
It's a shame these calls are not included in the Javascript library. It should be trivial enough for me to customise the library and add them myself though.
The documentation is installed with FME Server. Go to the following address in your browser on the machine you installed FME Server:
http://localhost/fmerest/v2/apidoc/
Or substitute "localhost" with the name of the server.
The call for finished jobs seems to be;
GET /transformations/jobs/completed
Found through trial and error.
Yes, you're right. Sorry about the confusion.