GET /os-services/{id} should be a 405 instead of 404

Bug #1697403 reported by Abhishek Kekane
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Confirmed
Low
Unassigned

Bug Description

As of now get service API (show) is not present and it returns the 404 ResourceNotFound error.
As per api-wg guidelines [1] it should return 405 Method Not Allowed.

Steps to reproduce:

1. Use curl command to show service details.
   $ curl -g -i -X GET http://10.232.48.201:8774/v2.1/os-services/5 -H "OpenStack-API-Version: compute 2.46" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-OpenStack-Nova-API-Version: 2.46" -H "X-Auth-Token: f7acf40a4fd848bf885de53e606fa12c"

Output:

HTTP/1.1 404 Not Found
Content-Length: 112
Content-Type: application/json
X-Openstack-Request-Id: req-e8682adf-1013-4ff5-8903-16dc3a26984d
X-Compute-Request-Id: req-e8682adf-1013-4ff5-8903-16dc3a26984d
Date: Mon, 12 Jun 2017 09:49:24 GMT

{"message": "The resource could not be found.<br /><br />\n\n\n", "code": "404 Not Found", "title": "Not Found"}

Expected output:

If a request is made to a known resource URI, but the HTTP method used for the request is not supported for that resource, the return code should be 405 Method Not Allowed.

[1] https://specs.openstack.org/openstack/api-wg/guidelines/http.html#failure-code-clarifications

Tags: api
Changed in nova:
assignee: nobody → Abhishek Kekane (abhishek-kekane)
Changed in nova:
assignee: Abhishek Kekane (abhishek-kekane) → Bhagyashri Shewale (bhagyashri-shewale)
Revision history for this message
Takashi Natsume (natsume-takashi) wrote :

I can reproduce the bug at master (commit 3a5d592e607176f4159ff65b6df0e2b552156aaf).

Changed in nova:
status: New → In Progress
tags: added: api
Revision history for this message
Sean Dague (sdague) wrote :

There are no currently open reviews on this bug, changing the status back to the previous state and unassigning. If there are active reviews related to this bug, please include links in comments.

Changed in nova:
status: In Progress → New
assignee: Bhagyashri Shewale (bhagyashri-shewale) → nobody
Sean Dague (sdague)
Changed in nova:
status: New → Confirmed
importance: Undecided → Low
Sean Dague (sdague)
summary: - get API call for service raises ResourceNotFound error
+ GET /os-services/{id} should be a 405 instead of 404
Changed in nova:
assignee: nobody → Bhagyashri Shewale (bhagyashri-shewale)
Changed in nova:
status: Confirmed → In Progress
Revision history for this message
Sean Dague (sdague) wrote :

There are no currently open reviews on this bug, changing the status back to the previous state and unassigning. If there are active reviews related to this bug, please include links in comments.

Changed in nova:
status: In Progress → Confirmed
assignee: Bhagyashri Shewale (bhagyashri-shewale) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.