[Iplant-api-dev] Getting a list of pending jobs

Rion Dooley dooley at tacc.utexas.edu
Tue Aug 13 11:27:18 MST 2013


I'll double check if that bled in from the v2 beta, but the response should not have changed in nearly a year.

-
Rion

----- Reply message -----
From: "Darren Boss" <dboss at email.arizona.edu>
To: "Rion Dooley" <dooley at tacc.utexas.edu>
Cc: "iPlant API Developers Mailing List" <iplant-api-dev at iplantcollaborative.org>
Subject: [Iplant-api-dev] Getting a list of pending jobs
Date: Tue, Aug 13, 2013 1:20 PM

I was asking why it's there where it didn't seem to be there before. I
fixed my code so it checks for a a key first before accessing any
elements. Could be I only tested the code previously where just one
app was returned by the query.

The json returned by v1 calls shouldn't change from this point on, correct?

On Tue, Aug 13, 2013 at 2:03 PM, Rion Dooley <dooley at tacc.utexas.edu> wrote:
> I'm not sure I understand the question. Are you asking if it was there
> before or why it is now first? The order didn't change per se. Actually,
> order is not guaranteed in json responses.
>
> -
> Rion
>
> ----- Reply message -----
> From: "Darren Boss" <dboss at email.arizona.edu>
> To: "Rion Dooley" <dooley at tacc.utexas.edu>
> Cc: "iplant-api-dev at iplantcollaborative.org"
> <iplant-api-dev at iplantcollaborative.org>
> Subject: [Iplant-api-dev] Getting a list of pending jobs
> Date: Tue, Aug 13, 2013 12:57 PM
>
> Nice, somehow I missed the api calls for returning jobs based on their
> status. Those will come in useful.
>
> Unrelated to this I'm having some of my code fail and it looks like
> there may have been a change in the json being returned by
> /apps-v1/apps/list calls. Was there always a 'count' element as the
> first entry in the results?
>
> On Tue, Aug 13, 2013 at 1:50 PM, Rion Dooley <dooley at tacc.utexas.edu> wrote:
>> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iplantcollaborative.org/pipermail/iplant-api-dev/attachments/20130813/d6420bc7/attachment.html 


More information about the Iplant-api-dev mailing list