Bug 731577 - RFE: Need API to query jobs by owner, target and principal
Summary: RFE: Need API to query jobs by owner, target and principal
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 0.5
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Jesus M. Rodriguez
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-17 21:24 UTC by Jordan OMara
Modified: 2015-05-14 15:21 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-07-17 13:03:17 UTC


Attachments (Terms of Use)

Description Jordan OMara 2011-08-17 21:24:11 UTC
You guys have a /jobs API to query jobs by job id. You also save the owner, principal and target id in the jobs DB. However, you cannot query by these fields. We would like this feature so we can check when a particular org or consumer has an outstanding async job, so we can disable him from requesting another one. 

Example: 

/jobs/bind_by_pool_3545275d-8468-4c0b-b75d-b1462a906ffb

This returns exactly what we want - but at the time we need it in RHSM-WEB, we don't have access to the job id.

Version-Release number of selected component (if applicable):
0.4

Thanks!

Comment 1 Jesus M. Rodriguez 2011-08-30 13:22:28 UTC
Fixed in 3bc5adcd7f8d094f3dedf2a7354efc0a06804b4f

Comment 2 Jesus M. Rodriguez 2011-08-30 13:23:09 UTC
To verify have pinsetter enabled and run the following curl commands:

Create a refresh job:
curl -k -u admin:admin -X PUT
https://localhost:8443/candlepin/owners/admin/subscriptions

Get back a list of the admin owned jobs (should return the above refresh
pools job):

curl -k -u admin:admin https://localhost:8443/candlepin/jobs/?owner=admin

Get back a list of the admin jobs by user (same as above):
curl -k -u admin:admin https://localhost:8443/candlepin/jobs/?principal=admin

Get back all the System jobs (should return all of the cron ones):
curl -k -u admin:admin https://localhost:8443/candlepin/jobs/?principal=System

Get back an empty list, basically no jobs exist for this principal:
curl -k -u admin:admin https://localhost:8443/candlepin/jobs/?principal=foo

Get back an error that you must specify some parameters:
curl -k -u admin:admin https://localhost:8443/candlepin/jobs/?principal=

Get back an error that you must specify only one of the parameters:
curl -k -u admin:admin
"https://localhost:8443/candlepin/jobs/?owner=admin&principal=foo&consumer=abcd"

Anything else you can think of.

Comment 3 Bryan Kearney 2012-07-17 13:03:17 UTC
Marking all community bugs modified or beyong as closed.


Note You need to log in before you can comment on or make changes to this bug.