Commit Graph

7 Commits

Author SHA1 Message Date
ghanshyam f4ec8116ae Merge server create schema for scheduler hint extension
As nova extensions has been deprecated already and goal is to
merge all scattered code into main controller side.
Currently schema and request/response extended code are there
among all extensions.

This commit merge the schema part of create server for scheduler
hint extensions.

Partially implements: blueprint api-extensions-merge-rocky

Change-Id: I7d15614051d4a38b74b0fc9e5c751fdc3f64cb1c
2018-06-27 14:09:02 +00:00
Matt Riedemann a6fcfb28ae api-ref: document caveats with scheduler hints
I noticed this while working on change
I49ffebcd129990f1835f404d98b51732a32171eb and I realized
the scheduler_hints in the legacy filter_properties
dict is a bit different than what's in the RequestSpec
object, namely that the request validation schema is
per-hint. Some require a single value, like 'group', and
some accept a list of values, like 'different_host'.

Given how nebulous scheduler hints are, we should probably
note these in the API reference for the parameter, especially
because scheduler hints should not be considered interoperable.

Change-Id: I74114fc56bee2bebf4a5f5d6823ec968cad9a8e9
2017-10-30 16:14:28 -04:00
Balazs Gibizer 5cc5a84110 Return HTTP 400 for invalid server-group uuid
Nova API checks that the value of the group scheduler hint
shall be a valid server-group uuid, however it was done by custom
code not jsonschema. Moreover the exception was not handled by the API
so both v2.0 and v.2.1 returned HTTP 500 if the group hint wasn't a valid
uuid of an existing server group.

The custom code to check for the validity of the group uuid is kept in
nova.compute.api as it is still needed in v2.0.

In v2.0 InstanceGroupNotFound exception are now translated to HTTPBadRequest.

In v2.1 the scheduler_hint jsonschema is now extended to check the format
of the group hint and the api is now translates the InstanceGroupNotFound
to HTTPBadRequest.

Closes-bug: #1535759
Change-Id: I38d98c74f6cceed5b4becf9ed67f7189cba479fa
2016-02-08 14:10:49 +01:00
Ken'ichi Ohmichi 2841dd3de9 Make scheduler_hints schema allow list of id
Nova v2.0 API allows a list of server_id, and the corresponding
filter handles it. However, Nova v2.1 API doesn't do that now.
That is backward incompatibile issue.
This patch fixes this issue.

NOTE: Tempest patch Ib3365ac2783a0578c7a1a1e72d9b6c9cfea340f5
      is for reproducing this problem on the gate.
      After this fixing, the Tempest patch can be merged and
      we will be able to block this problem.

Change-Id: I1de7d184c590e84ab1b38880c8d784d38c37b820
Closes-Bug: #1521928
2015-12-21 12:29:27 +00:00
Ken'ichi Ohmichi 029ad7e123 Add API schema for different_cell filter
For using the different cell filter, the API parameter different_cell
needs to be passed to the corresponding filter. However v2.1 API
validation denies it because there is not API parameter definition
and it didn't work at all.
This patch adds the API schema.

Change-Id: Ic61b9a18722b7701b09e71f3f3a547ad9e6363c2
Closes-Bug: #1492925
2015-09-10 23:36:49 +00:00
John Garbutt 4a29486f4c api: allow any scheduler hints
To help with v2.1 compat mode, we need to allow users to pass in any
scheduler hints, to allow for out of tree extensions.

This includes ensuring the soft additional properties validator does not
strip out extra properties when they are allowed by the schema.

As this Mail:
http://lists.openstack.org/pipermail/openstack-dev/2015-June/067996.html
pointed out the limit the scheduler-hints in the API is problematic. This
patch relax the validation of scheduler hints for v2.1 also.

Co-Authored-By: Ed Leafe <ed@leafe.com>
Co-Authored-By: Alex Xu <hejie.xu@intel.com>
Change-Id: I4c066075165f69d355a74979808fa0ad8d6546ab
2015-09-09 10:21:09 +08:00
He Jie Xu 3e032fd45b Remove 'v3' directory for v2.1 json-schemas
This is step 4 of the remove v3 process. It moves the v2.1
json-schemas out of v3 directory, and also corrects all the
references.

Change-Id: Ibf88c38df951ed755b7431846cca7496f861c1dd
Partial-Bug: #1462901
2015-08-13 09:58:48 +08:00