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
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 0.5
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: ---
Assignee: Jesus M. Rodriguez
QA Contact: John Sefler
Depends On:
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:
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. 



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):


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

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

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.