Bug 1111297
Summary: | no error status code when retrieved event listener with a given id does not exist | ||
---|---|---|---|
Product: | [Retired] Pulp | Reporter: | Irina Gulina <igulina> |
Component: | API/integration | Assignee: | pulp-bugs |
Status: | CLOSED UPSTREAM | QA Contact: | Irina Gulina <igulina> |
Severity: | unspecified | Docs Contact: | |
Priority: | medium | ||
Version: | 2.4 Beta | CC: | bcourt, jcline, skarmark |
Target Milestone: | --- | Keywords: | Triaged |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2015-02-28 22:11:05 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Irina Gulina
2014-06-19 16:35:40 UTC
This is returning a 404. It is returning more data in addition to the 404 but the HTTP error code is being returned properly. I've untriaged this after a discussion with Barnaby. We aren't terribly consistent about what we return when a 404 occurs, so we need to decide what the correct response is and be consistent with that decision. Below are two possible results for a 404. This is the output for a missing event listener: curl -i -H "Accept: application/json" -X GET -u admin:admin -k 'https://localhost/pulp/api/v2/events/notanevent/' HTTP/1.1 404 Not Found Date: Thu, 07 Aug 2014 13:10:17 GMT Server: Apache/2.4.10 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.5 Python/2.7.5 Content-Encoding: utf-8 Content-Length: 416 Content-Type: application/json { "_href": "/pulp/api/v2/events/notanevent/", "error": { "code": "PLP0009", "data": { "resources": { "event_listener": "notanevent" } }, "description": "Missing resource(s): event_listener=notanevent", "sub_errors": [] }, "error_message": "Missing resource(s): event_listener=notanevent", "exception": null, "http_request_method": "GET", "http_status": 404, "resources": { "event_listener": "notanevent" }, "traceback": null } This is the same output you'll see from /pulp/api/v2/repositories/notarepository/ or /pulp/api/v2/consumers/notaconsumer/ This is the output from retrieving the schedules for a consumer that doesn't exist: curl -i -H "Accept: application/json" -X GET -u admin:admin -k 'https://localhost/pulp/api/v2/consumers/notaconsumer/schedules/' HTTP/1.1 404 Not Found Date: Thu, 07 Aug 2014 15:43:54 GMT Server: Apache/2.4.10 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.5 Python/2.7.5 Content-Length: 9 Content-Type: text/html; charset=UTF-8 not found Moved to https://pulp.plan.io/issues/457 |