[Iplant-api-dev] Getting a list of pending jobs
Rion Dooley
dooley at tacc.utexas.edu
Tue Aug 13 10:50:28 MST 2013
Hi Darren,
I don't know if you were referring to the DE or Foundation. If you're asking about querying for Foundation jobs by their status, the job listing service will let you do that.
curl -sku "$API_USERNAME:$API_TOKEN" https://foundation.iplantcollaborative.org/apps-v1/jobs/list/status/PENDING
The following one-liner will return just the job ids from the jobs with the given status.
$> curl -sku "$API_USERNAME:$API_TOKEN" https://foundation.iplantcollaborative.org/apps-v1/jobs/list/status/ARCHIVING_FINISHED | python -mjson.tool | grep -E '^ +"id"' | perl -pe "s/\"id\"://; s/\"//g; s/,//; s/ //g;"
In a more readable format it would be:
$> curl -sku "$API_USERNAME:$API_TOKEN" \
https://foundation.iplantcollaborative.org/apps-v1/jobs/list/status/ARCHIVING_FINISHED | \
python -mjson.tool | \
grep -E '^ +"id"' | \
perl -pe "s/\"id\"://; s/\"//g; s/,//; s/ //g;"
Here are all the available job statuses:
PENDING, STAGING_INPUTS, CLEANING_UP, ARCHIVING, STAGING_JOB,
FINISHED, KILLED, FAILED, STOPPED, RUNNING, PAUSED, QUEUED, SUBMITTING,
STAGED, PROCESSING_INPUTS, ARCHIVING_FINISHED, ARCHIVING_FAILED
In case you were wondering, you can query by a other fields in the url as well. status, softwareName, and system are all supported. The url template regex actually looks like this:
/apps-v1/jobs/list[/$key/$value]+
So you can query by one or more key value pairs simply by appending them in any order in the url. For example, to query for all running jobs on stampede, you would use the above one-liner to the following url:
https://foundation.iplantcollaborative.org/apps-v1/jobs/list/status/RUNNING/system/stampede.tacc.xsede.org
To query for all jobs running head-stampede-5.97u2, you would use the above one-liner to the following url:
https://foundation.iplantcollaborative.org/apps-v1/jobs/list/softwareName/head-stampede-5.97u2
If you run into any problems or have other questions, just let me know.
cheers,
Rion
________________________________________
From: iplant-api-dev-bounces at iplantcollaborative.org [iplant-api-dev-bounces at iplantcollaborative.org] on behalf of Andy Edmonds [aedmonds at iplantcollaborative.org]
Sent: Tuesday, August 13, 2013 11:45 AM
To: Rion Dooley
Cc: Discussion of iPlant API development
Subject: Re: [Iplant-api-dev] Getting a list of pending jobs
Hi Darren,
The condor_q command will show the jobs submitted by the submit node
you are using. To see all condor jobs use 'condor_q -global'. If the
jobs are FAPI jobs, you will only see that the jobs is submitted and
running on condor. You won't be able to see what is happening on the
tacc side.
Thanks...
-Andy-
Andy Edmonds
University of Arizona
Keating Research Institute - iPlant Collaborative
Senior Systems Administrator - Core Services
Email: aedmonds at iplantcollaborative.org
Phone: 520-626-4279
On 8/13/13 9:40 AM, Darren Boss wrote:
> Am I able to get a list of pending jobs or must I always track the id
> returned at submission time? I don't see PENDING in the status of any
> jobs when looking at past jobs.
>
> I will keep track of the ids that I submit in my applications but
> while testing out code this feature would come in handy.
> _______________________________________________
> Iplant-api-dev Mailing List: Iplant-api-dev at iplantcollaborative.org
> List Info and Archives: http://mail.iplantcollaborative.org/mailman/listinfo/iplant-api-dev
> One-click Unsubscribe: http://mail.iplantcollaborative.org/mailman/options/iplant-api-dev/aedmonds%40iplantcollaborative.org?unsub=1&unsubconfirm=1
_______________________________________________
Iplant-api-dev Mailing List: Iplant-api-dev at iplantcollaborative.org
List Info and Archives: http://mail.iplantcollaborative.org/mailman/listinfo/iplant-api-dev
One-click Unsubscribe: http://mail.iplantcollaborative.org/mailman/options/iplant-api-dev/dooley%40tacc.utexas.edu?unsub=1&unsubconfirm=1
More information about the Iplant-api-dev
mailing list