Commit Graph

2 Commits

Author SHA1 Message Date
Lucas Alvares Gomes
6be3448d40 Follow-up patch of 8e5e69869d
This patch is a follow-up patch of
8e5e69869d addressing some the remaining
comments after the patch was merged. The changes are:

* Optimize the code by generating the list of reserved words for the
  nodes controller only once.

* List the reserved words in the release note.

* Improve the error string when someone tries to name a node using a
  reserved word.

* Add a comment for future reference indicating how we should try to
  model the API in case a new sub-controller needs to be added to the
  nodes controller class.

Change-Id: I43d6d9e2e92cc941a7839c60d9cd361cd94b6208
2016-05-25 16:02:25 -04:00
Lucas Alvares Gomes
8e5e69869d API: Check for reserved words when naming a node
This patch is introducing a mechanism which prevents nodes to be named
with some reserved words that are implicitly not allowed today due the
way the Ironic API works.

For example, the way we fetch a node by its name in the API is issuing
a GET to the http://<address>/v1/nodes/<node name> but, we have some
words that are valid endpoints under the same path. One example is of it
is the /detail endpoint, a GET request to v1/nodes/detail should return
detailed information about all the nodes.

Apart from that, due the way pecan/wsme parses/routes the requests
the words 'ports', 'vendor_passthru', 'management', 'maintenance' can
not be used. These words are attributes pointing to a controller in the
node's API object (e.g v1/nodes/(ident)/ports) and naming a node as such
confuses pecan/wsme.

The API microversion was not bumped because this error should be
prevented across all versions.

Closes-Bug: #1572651
Change-Id: Ibba5ed16e6961805864bdf46b94296b1b0c09469
2016-05-04 11:49:01 +01:00