Commit Graph

3 Commits

Author SHA1 Message Date
ghanshyam 43f4755d5e Merge server create schema for availability zone 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 AZ extensions.

Partially implements: blueprint api-extensions-merge-queens
Change-Id: I3671e63187b79cb7a80594d4d7a948565a9003bb
2018-01-25 03:12:06 +00:00
He Jie Xu 4354163c1e Filter leading/trailing spaces for name field in v2.1 compat mode
In the V2 API, there are three cases for the name field:

1. disallow any space in the name: server_groups.

2. allow leading/trailing whitespaces, strip spaces and disallow
all characters are spaces: flavor_manage, servers.

3. allow leading/trailing whitespacess, no strip spaces and allow
all characters are spaces: aggregates, cells, create_backup,
security_groups, create_image, rebuild

But currently in the V2.1 API and V2.1 API compat mode disallows
leading/trailing in the name field.

For the V2.1 compat mode, we should relax the validation to avoid
breaking the user, although leading/trailing is unclear usecase. This
patch allows leading/trailing spaces but will strip them, and still
disallows that all characters are spaces in the name fields for
flavor_mange, servers, aggregates(and availability_zones),
create_backup, create_image, rebuild.

Due to the server_groups and security_groups(no jsons-schema in v2.1)
have consistent behavior between v2 and v2.1. So this patch won't
change server_groups.

But when creating servers, the name of security_groups, availability_zone
and keyapir isn't stripped the leading/trailing spaces. This is for
backward compatible with users who already use legacy V2 API created
security_group, availabilit_zone and keypair with leading/trailing
in the name, otherwise the users can't use those resource anymore.

For supporting servers schema extension point returns legacy v2 schema,
this patch adds version parameter to the schema extension point. Then
extension point can return different schema based on the version
parameter.

Change-Id: I9442891272284d395ea0dd8cfa302d3f74bf13ec
Partial-Bug: #1498075
2015-09-23 10:27:54 +01: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