ironic/ironic/api
Dmitry Tantsur cfc167eadf Stop guessing mime types based on URLs
Currently we have a pecan feature enabled that strips extensions
from the end of the URL and treat it like requested content type.
E.g. /v1/nodes.json is treated as /v1/nodes with requested content
type Application/Json. However, this prevents certain node names:
e.g. /v1/nodes/small.1 is treated like /v1/nodes/small with content
type of a man page. It does not make any sense for ironic API,
as we only support Application/Json content type (and .json suffix).

This change disabled this pecan feature. To keep backward compability
a new middleware stips the .json prefix and saves a flag in the
environment about its presence. API accepting names try to find
their resource first without, then with .json suffix.

The following endpoints are special-cased to support names with .json:
* Node GET, PATCH and DELETE
* Ramdisk heartbeat
* Port group GET, PATCH and DELETE

VIF API is not updated, so VIF IDs still cannot have .json suffix.

Change-Id: I789ecfeac9b64a9c4105a20619f7bf5dfc133189
Closes-Bug: #1643995
2018-02-07 20:58:35 +00:00
..
controllers Stop guessing mime types based on URLs 2018-02-07 20:58:35 +00:00
middleware Stop guessing mime types based on URLs 2018-02-07 20:58:35 +00:00
__init__.py Centralize config options - [api] 2016-07-21 11:51:45 -07:00
app.py Stop guessing mime types based on URLs 2018-02-07 20:58:35 +00:00
app.wsgi Add uWSGI support 2017-12-28 18:08:49 +02:00
config.py Remove agent vendor passthru completely 2016-12-13 09:31:08 +02:00
expose.py Disable XML now that we have WSME/Pecan support 2015-04-06 09:31:09 -07:00
hooks.py Remove translation of log messages from ironic/api 2017-04-05 09:53:58 -07:00
wsgi.py Add uWSGI support 2017-12-28 18:08:49 +02:00