Project

Profile

Help

Issue #796

closed

Provide helpful message when history is not found for consumer X

Added by ipanova@redhat.com over 9 years ago. Updated over 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
1. Low
Version:
Platform Release:
2.7.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

$ curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X GET -k -u admin:admin "https://localhost/pulp/api/v2/consumers/invalid/history/"
HTTP/1.1 404 Not Found
Date: Wed, 18 Mar 2015 16:19:10 GMT
Server: Apache/2.4.10 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.5 Python/2.7.5
Content-Length: 4
Content-Type: application/json

null

I expect;

$ curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: django" -X GET -k -u admin:admin "https://localhost/pulp/api/v2/consumers/invalid/history/"
HTTP/1.1 404 NOT FOUND
Date: Wed, 18 Mar 2015 16:19:14 GMT
Server: Apache/2.4.10 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.5 Python/2.7.5
Content-Length: 29
Content-Type: text/html; charset=utf-8

No history found for: invalid

Actions #1

Updated by ipanova@redhat.com over 9 years ago

  • Status changed from ASSIGNED to POST
Actions #2

Updated by bmbouter over 9 years ago

  • Severity changed from Low to 1. Low
Actions #3

Updated by ipanova@redhat.com over 9 years ago

  • Status changed from POST to MODIFIED
Actions #4

Updated by dkliban@redhat.com over 9 years ago

  • Platform Release set to 2.7.0
Actions #5

Updated by dkliban@redhat.com over 9 years ago

  • Status changed from MODIFIED to 5
Actions #6

Updated by igulina@redhat.com over 9 years ago

  • Status changed from 5 to 6

Verified.

>> rpm -qa pulp-server
pulp-server-2.7.0-0.3.beta.el7.noarch

History for an existing consumer

>> curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X GET -k -u admin:admin "https://localhost/pulp/api/v2/consumers/gosha/history/" 
HTTP/1.1 200 OK
Date: Fri, 26 Jun 2015 16:11:00 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Content-Length: 1661
Content-Type: application/json

[{"originator": "SYSTEM", "timestamp": "2015-06-26T15:12:53Z", "consumer_id": "gosha", "details": {"units": [{"unit_key": {"name": "babarashka"}, "type_id": "rpm"}]}, "_ns": "consumer_history", "_id": {"$oid": "558d6bf5e512ed779aa83ad8"}, "type": "content_unit_installed", "id": "558d6bf5e512ed779aa83ad8"}, {"originator": "SYSTEM", "timestamp": "2015-06-26T15:11:55Z", "consumer_id": "gosha", "details": {"units": [{"unit_key": {"name": "babarashka"}, "type_id": "rpm"}]}, "_ns": "consumer_history", "_id": {"$oid": "558d6bbbe512ed779aa83ad5"}, "type": "content_unit_installed", "id": "558d6bbbe512ed779aa83ad5"}, {"originator": "admin", "timestamp": "2015-06-26T14:50:03Z", "consumer_id": "gosha", "details": {"profile_content_type": "mytype"}, "_ns": "consumer_history", "_id": {"$oid": "558d669be512ed777daefd1c"}, "type": "unit_profile_changed", "id": "558d669be512ed777daefd1c"}, {"originator": "admin", "timestamp": "2015-06-26T14:40:19Z", "consumer_id": "gosha", "details": {"profile_content_type": "rpm"}, "_ns": "consumer_history", "_id": {"$oid": "558d6453e512ed777ec43a25"}, "type": "unit_profile_changed", "id": "558d6453e512ed777ec43a25"}, {"originator": "admin", "timestamp": "2015-06-26T14:39:16Z", "consumer_id": "gosha", "details": {"profile_content_type": "rpm"}, "_ns": "consumer_history", "_id": {"$oid": "558d6414e512ed777daefd16"}, "type": "unit_profile_changed", "id": "558d6414e512ed777daefd16"}, {"originator": "admin", "timestamp": "2015-06-26T14:39:09Z", "consumer_id": "gosha", "details": null, "_ns": "consumer_history", "_id": {"$oid": "558d640de512ed777ec43a20"}, "type": "consumer_registered", "id": "558d640de512ed777ec43a20"}]

Hisotry for nonexisting consumer

>> pulp-consumer -u admin -p admin unregister
Consumer [gosha] successfully unregistered

>> curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X GET -k -u admin:admin "https://localhost/pulp/api/v2/consumers/gosha/history/" 
HTTP/1.1 404 NOT FOUND
Date: Fri, 26 Jun 2015 16:11:47 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Content-Encoding: utf-8
Content-Length: 378
Content-Type: application/json

{"http_request_method": "GET", "exception": null, "error_message": "Missing resource(s): consumer=gosha", "_href": "/pulp/api/v2/consumers/gosha/history/", "http_status": 404, "error": {"code": "PLP0009", "data": {"resources": {"consumer": "gosha"}}, "description": "Missing resource(s): consumer=gosha", "sub_errors": []}, "traceback": null, "resources": {"consumer": "gosha"}}[

History for fresh registered consumer

>> pulp-consumer -u admin -p admin register --consumer-id maruska
Consumer [maruska] successfully registered

>> curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X GET -k -u admin:admin "https://localhost/pulp/api/v2/consumers/maruska/history/" 
HTTP/1.1 200 OK
Date: Fri, 26 Jun 2015 16:12:14 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Content-Length: 242
Content-Type: application/json

[{"originator": "admin", "timestamp": "2015-06-26T16:12:07Z", "consumer_id": "maruska", "details": null, "_ns": "consumer_history", "_id": {"$oid": "558d79d7e512ed777ffdc63d"}, "type": "consumer_registered", "id": "558d79d7e512ed777ffdc63d"}]

Empty list is returned if the history for specified event type is not found for existing consumer:

>> curl -i -H "Accept: application/json" -H "WebFrameworkSwitch: webpy" -X GET -ku admin:admin "https://localhost/pulp/api/v2/consumers/maruska/history/?event_type=repo_bound" 
HTTP/1.1 200 OK
Date: Fri, 26 Jun 2015 16:29:54 GMT
Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Content-Length: 2
Content-Type: application/json

[]
Actions #7

Updated by amacdona@redhat.com almost 9 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE
Actions #9

Updated by bmbouter over 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF