Commit Graph

12 Commits

Author SHA1 Message Date
ghanshyam 67d3448136 Merge config drive extension response into server controller
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 config drive extension resposne into server controller.

Partially implements: blueprint api-extensions-merge-stein

Change-Id: I5725e37b5640b91f388af9b12ac1b3dad4d438a7
2018-08-21 10:53:14 -04:00
ghanshyam f72fa9a739 Remove the deprecated API extensions policies
API extensions policies have been deprecated in 17.0.0
release[1]. This commit removes them.

[1] Ie05f4e84519f8a00ffb66ea5ee920d5c7722a66b
Change-Id: Ib3faf85c78bc2cdee13175560dc1458ddb6cb7a8
2018-08-17 07:11:45 +00:00
ghanshyam c21d6fd6ac Merge server create for config_drive 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 server_create for config_drive extensions.

Partially implements: blueprint api-extensions-merge-rocky

Change-Id: If20ff2c85263aed92308f1fad59a1ab7bbff3e0e
2018-07-19 06:34:05 +00:00
ghanshyam 6c731b4423 Merge server create schema for config drive 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 config extensions.

Partially implements: blueprint api-extensions-merge-rocky

Change-Id: I0bdb82c1692c547be6edc9729b2fd3e415b35646
2018-06-27 14:05:43 +00:00
He Jie Xu 68bbddd8ae Totally freeze the extension_info API
The extension will be removed from the Nova API totally. The extension_info
API is just for backward compatibility. And there is no way to disable/enable
the extension, also the discovery policy rules are removed, so it is time
to just hard-code most of the logic at here.

Partial-implement-blueprint api-no-more-extensions-pike

Change-Id: I56d859beb675199b209587bfe0a23cd9b75233ad
2017-05-08 16:32:48 +08:00
He Jie Xu 56d7c05d3f Remove the stevedore extension point for server create
This patch remove the stevedore extension point for server
create.

This patch move all the extension points into ServersController
class attribute 'server_create_func_list'. This is for
backward-compatible with the stevedore extension interface.

The final goal is that merging all of those extended code into
the ServerController. So this is a middle step for refactor.

Partial-implement-blueprint api-no-more-extensions-pike

Change-Id: I9a8f56037b35e89543626922221b910ab8b1917e
2017-04-06 18:52:11 +00:00
He Jie Xu 4ca9e3667a Remove the json-schema extension point of server create
To get rid of all of stevedore extension point. The
jsons-chema extension point of server create should be
removed. This patch moves all of extended json-schema into
ServerControoler's class attributes 'schema_func_list'.

But the final goal is that merging all of those extended
json-schema into server's main json-schema. So this is a
middle step for all of those refactor for removing stevedore.

Partial-implement-blueprint api-no-more-extensions-pike

Change-Id: Id8ba6a0383cf236259224ace2df3c3d89f82f27d
2017-04-06 18:51:56 +00:00
Claudiu Belu 93cc5e3ffd policy: Replaces 'authorize' in nova-api (part 2)
Adds 'fatal' argument (with default value True) to context.
If the argument is False, if a nova.exception.Forbidden
is raised, False is returned instead. This is the equivalent of
soft_authorize.

Adds docstring to nova.context.RequestContext.can.

Adds unit tests for nova.context.RequestContext.can.

Partially-Implements: bp policy-in-code

Change-Id: Ib6388822da3d3eb9b8fbd9b5c341cd8efeb790fe
2016-06-27 13:18:03 +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
EdLeafe 55e04230ad Rename classes containing 'v3' to 'v21'
This part of the ongoing v3 cleanup effort.

Partial-Bug: #1462901
Change-Id: I5d9b43503629cc3f5a566f7bfa23cc5d0d14d985
2015-08-18 15:25:46 +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
EdLeafe 003c868da7 Move v2.1 code to the main compute directory - remove v3 step3
Move all the plugins/v3 code to the main compute directory.

Partial-Bug: #1462901
Change-Id: I7df413b76ff0a6610ccd3cb90137ec99b372d5ab
2015-08-13 09:58:47 +08:00