Currently v2 and v2.1 have separate functional tests and their
corresponding sample files. As v2 and v2.1 are supposed to be identical,
there is overhead to maintain two set of functional tests and sample files.
We can have one set of tests which can run for both v2 and v2.1.
This commit use the testscenearios to generate the tests one for v2 and one for v2.1
and make v2.1 tests to run against v2.1 plugins by redirecting /v2 endpoint to v2.1
plugins in api-paste.ini
As example this commit merge flavor APIs functional tests between v2 & v2.1.
In V2 flavor API has following extensions
- Flavor_swap
- Flavor_disabled
- Flavorextradata
In V2.1 above extensions have been merged together in flavor plugins
NOTE- As testscenarios is applied in base class. v2 tests will be generated
for all the existing tests but for tests which are not merged yet
their v2 generated tests will be skipped till they gets
merged. After merge, both version tests are expected to pass like
flavor tests in this patch. So you may see lot of skipped tests
which is expected and will gets disappear as tests gets merged.
Change-Id: I0e0262f818c7d7fb15528b16d3225b9578910996
There are lot of duplicate sample files for server POST req/resp
in functional tests.
This patch reuse the server post req/resp sample file for V2.1
functional tests.
Change-Id: I5da924b78780eae64a40ee39ee4fbe1e5b8c3b1f
This change adds properties to v2.1
os-extended-server-properties and os-extended-volumes nova APIs
in order to expose information which is required for the standalone
EC2 API implementation (resides on stackforge/ec2-api) to use only
public APIs. Right now this information is taken by directly accessing
internal Nova DB.
It adds proposed microversion v2.3.
It implements the spec "Nova changes required for standalone EC2 API
implementation" in this review: https://review.openstack.org/#/c/153636/
APIImpact
Implements: blueprint ec2-api
Change-Id: I850e51e730c82906f68fddb14fb0004d7091eb91
X509 certificates are used by Windows for passwordless
authentication (WinRM) in a way which can be considered
consistent with the usage of SSH keys on Linux, as both
are based on public / private keypairs.
Enables nova-api to return the keypair type, updates
nova-api version to reflect the changes and updates the
unit and functional tests to validate the API changes.
Unit tests have been updated to ensure that the keypair
type is not being returned on previous API versions.
Note: x509 keypair implementation is added in the next
commit.
DocImpact - See nova/api/openstack/rest_api_version_history.rst
for details
APIImpact
Depends-On: Id5b210d7afe5c0a590abcbd42b9ff85b071a5c55
Co-Authored-By: Chris Yeoh <cyeoh@au1.ibm.com>
Partially implements: blueprint keypair-x509-certificates
Change-Id: I215662f2f92a01921a866c3218031787a9eaf915
V2.1 server update and rebuild response contain
'OS-EXT-IPS:type' & 'OS-EXT-IPS-MAC:mac_addr' in address field
which are new attributes compared to V2 response for those API.
These new attributes are found during tempest testing by blocking
additional properties in schema -https://review.openstack.org/#/c/156130/
V2.1 must be identical with V2 and must not contain any new attributes in
response. This commit removes these new attributes from V2.1 API.
Partially implements blueprint v2-on-v3-api
Change-Id: Id5b210d7afe5c0a590abcbd42b9ff85b071a5c55
The pci plugin was only ever merged into the v3 (now v2.1 microversions)
and never the v2 API. Since v2.1 i meant to be identical to v2 it should not
appear in v2 either.
This change disables the pci api functionality in v2.1. It will be renabled
soon after microversions is enabled using a microversion bump.
Related-Bug: 1426241
Partially implements blueprint v2-on-v3-api
Change-Id: Ifc1d6f24d5a637270154b996087a98b41133e014
V2.1 must be identical with V2 and must not contain any new attributes
and new method. And those methods have same methods in the volumes
extensions. Those methods are added in the early stage of v3 works,
because the in early stage v3 works decides to delete any volume related
proxy API, then adds those method instead of them. This commit remove
these methods from V2.1 API.
Partially implements blueprint v2-on-v3-api
Change-Id: I20e0498ec187e9feafd2bfb1aa9646426b3609af
V2.1 server ips response contain 'OS-EXT-IPS:type' & 'OS-EXT-IPS-MAC:mac_addr'
also which are new attributes compared to V2 response.
These new attributes are found during tempest testing by blocking
additional properties in schema -https://review.openstack.org/#/c/156130/
V2.1 must be identical with V2 and must not contain any new attributes in
response. This commit removes these new attributes from V2.1 API.
Partially implements blueprint v2-on-v3-api
Change-Id: Id9fcce0c9629c3d325b87cf9b35f13f1ba15b13f
In case of v2.1, extended server status contain 'locked_by' which does
not match with V2 response.
These new attributes are found during tempest testing by blocking
additional properties in schema -https://review.openstack.org/#/c/156130/
V2.1 must be identical with V2 and must not contain any new attributes in
response. This commit removes this extra attributes from V2.1 API.
Partially implements blueprint v2-on-v3-api
Change-Id: I5c4f6851300510f8fc5342d3bfc596e0ac9f1800
In case of v2.1, update quota_set response contain 'id' which does
not match with V2 response.
These new attributes are found during tempest testing by blocking
additional properties in schema -
https://etherpad.openstack.org/p/Removal_new_attribute_V2_1
V2.1 must be identical with V2 and must not contain any new attributes in
response. This commit removes this extra attributes from V2.1 API.
Partially implements blueprint v2-on-v3-api
Change-Id: I7d1d03fadd1eaf90d9e37eb4f1dc330770f9ace9
In case of v2.1, if "os-access-ips" extension is enabled then server
POST response contain access ips attribute which does not match
with V2 response. V2 server POST response never have access ips attribute.
V2.1 must be identical with V2 and must not contain any new attributes in
response. This commit remove these extra attributes from V2.1 API.
V2 server POST response-
{
"server": {
"OS-DCF:diskConfig": "AUTO",
"adminPass": "ahW3PjQNAu6r",
"id": "e726f5ae-8179-44ba-bbfb-8a0c52b33095",
"links": [
{
"href": "http://openstack.example.com/v2/openstack/
servers/e726f5ae-8179-44ba-bbfb-8a0c52b33095",
"rel": "self"
},
{
"href": "http://openstack.example.com/openstack/
servers/e726f5ae-8179-44ba-bbfb-8a0c52b33095",
"rel": "bookmark"
}
],
"security_groups": [
{
"name": "default"
}
]
}
}
V2.1 server POST response-
{
"server": {
"OS-DCF:diskConfig": "AUTO",
"adminPass": "zPnp2GseTqG4",
"id": "8195065c-fea4-4d57-b93f-5c5c63fe90e8",
"links": [
{
"href": "http://openstack.example.com/v3/servers/
8195065c-fea4-4d57-b93f-5c5c63fe90e8",
"rel": "self"
},
{
"href": "http://openstack.example.com/servers/
8195065c-fea4-4d57-b93f-5c5c63fe90e8",
"rel": "bookmark"
}
],
"accessIPv4": "",
"accessIPv6": "",
"security_groups": [
{
"name": "default"
}
]
}
}
Partially implements blueprint v2-on-v3-api
Change-Id: Ib9197cc9061bbba0c040f237bb52d12a60a976d7
Currently the API sample get '?' for the cpu_info, this is really
confusing, it even does not tell the type of the return.
Change it to be more meaningful.
Change-Id: I791beb7502f47dff646a46c08e818c29f9e6cd79
Implements an API sample test for a GET request for os-baremetal-nodes
which was previously manually generated and wrong. Removes api samples
for add-interface, create, and remove-interface which were removed
for os-baremetal-nodes at some point.
This should bring the os-baremetal-nodes plugin in sync with reality
for both v2 and v2.1
Partially implements blueprint v2-on-v3-api
Change-Id: Ibd55b43368485b7f460ef6564f611df136275562
Looks like the api samples for os-baremetal-noes were added manually
and so either weren't correct in the first place or the api output
has changed since the first merge. This patch implements tests
for index method. More to follow in later patches
Partially implements bp v2-on-v3-api
Change-Id: I3bd421b9a8b9eb49d274c190d124aaac6fbd361f
The preserve ephemeral on rebuild functionality was merged into the servers plugin
code. This should never have happened and the hook for handling extra parameters
for the rebuild api used instead (otherwise we end up with monster functions).
This patch splits the relevant bits out to their own plugin.
Partially implements bp v2-on-v3-api
Change-Id: I0f35f897b9470039d509a97e6513c6cc806169b4
Changes some extension names (not aliases) in the v2.1 api to match
what they are in v2. This is for compatibility between v2.1 and v2
to ensure /extensions output matches. Longer term the extension names
don't really matter as users should just be using the extension alias
and /extensions will be replaced by microversions and json HOME. So its not
worth adding extra infrastructure which is capable of translating just the
extension name like we do with other parts of the v2.1 /extension information
Partially implements bp v2-on-v3-api
Change-Id: I22227496aec51c5f523112cf49af92f0fa124a10
The V2.1 API implementation does not have a 1-1 mapping of extensions
compared to the V2 API. For example because many of the dummy
extensions were only originally added in order to be able to signal to
the API clients that new functionality was available these were not
ported and functionally hard coded into the original plugin.
However in order to retain complete backwards compatibility we need
to have an /extensions output which is identical to the original
V2 API. This patch implements that backwards compatibility including
fields such as XML namespaces, links and updated which are no
longer supported.
Some minor testcase changes to reflect no real xml support in v2.1
now
Part of blueprint v2-on-v3-api
Change-Id: I8e63a684093dfe3a643c07b20e8080c1e950ed5a
Current v2.1 os-user-data extension only includes "v1.1" in the
description, but it confuses developers/users because of mismatching
versions. In addition, the other extensions doesn't contain version
number in their descriptions.
So this patch removes v1.1 from os-user-data extension's description.
Partially implements blueprint v2-on-v3-api
Change-Id: I6280a0633c0e416e4b1798a708035eaf8c979fba
Although os-user-data has an entry in nova.api.v3.extensions.server.create
in setup.cfg it is missing one in the general nova.api.v3.extensions list.
Without an entry the plugin does not appear in the extension list so this
patch adds an entry for it.
Partially implements blueprint v2-on-v3-api
Change-Id: I13fa049539b07ff901b36ae18eca59fbb1354794
- Add missing commas
- Replace single quote with double quote
- events field contains a list of events (event-create-req.json)
- Remove empty files
- Adds a JSON validation test to the docs pipeline
Co-Authored-By: Nicolas Simonds <nic@metacloud.com>
Change-Id: I9a4a9b6b8e2da73b5f25145be3b2faa44ebdb340
Cleanup in admin_actions, in v2.1 admin_actions api,
it only contains resetNetwork, injectNetworkInfo, os-resetState.
correct the doc string of extension class.
Pulled from gate because of upstream bug with oslo.concurrency
Partially implements blueprint v2-on-v3-api
Change-Id: Ide0a53993849828fe60c2fe6e6f22d5c67d2bb5a
Nova V2.1 API has strong input validation by making validation
through JSON schema.
This patch makes rebuild server schema 'additionalProperties' to False
as all rebuild server extensions are implemented in V2.1.
After this, V2.1 will not allow extra arg for rebuild server.
This patch also modify the corresponding rebuild server tests
for extra input passed in request body-
test_rebuild_admin_password_pass_disabled
test_create_and_rebuild_server
Access ip extension sample files
Partially implements blueprint v2-on-v3-api
Change-Id: Ib13b02cefb9617e8af3b62b81d2f7eb7cd88eab1
Nova V2.1 API has strong input validation by making validation
through JSON schema.
This patch makes create server schema 'additionalProperties' to False
as all create server extensions are implemented in V2.1.
After this, V2.1 will not allow extra arg for create server.
This patch also fix the API sample files which were passing extra arg in
create request body.
Partially implements blueprint v2-on-v3-api
Change-Id: Ib2a4272cbacb3011b800776577233545af3d9d4b
This patch changes some of the alias names to be compatible with v2.
so the extension info output will be as same with v2.
consoles -> os-consoles
flavor-extra-specs -> os-flavor-extra-specs
flavor-manage -> os-flavor-manage
Partially implements blueprint v2-on-v3-api
Change-Id: Ia8c6a0144e43134667636db9ba862b26f265a433
Changes from the v3 API /extensions interface format to the
v2 API format. Note that this does not yet list the same
extensions as the v2 api because in v2.1 some have been split
or renamed. This will be addressed in a future patch
Partially implements blueprint v2-on-v3-api
Change-Id: Icaf945b356fcbbe2126343ad01ee58cecd15100f
Ports virtual-interfaces extension and adapts it to the
v2.1/v3 API framework. API behaviour is identical.
- unittest code modified to share testing with both v2/v2.1
- Adds expected error decorators for API methods
Partially implements blueprint v2-on-v3-api
Change-Id: Ic25ae83ecfaaa461b6ddd044e04af844d02dd6b7
Updates the v2 and v3 /servers and /servers/detail APIs to support the
multiple sort keys and sort directions (using the 'sort_key' and
'sort_dir' parameters); these parameters can be specified multiple
times to create a list of sort keys and directions. These parameters
are passed from the API layer to the compute layer, then to the
instance layer (with updated version), then to the database layers,
and then to the common paginate_query function; the paginate_query
function already supports multiple sort keys and directions. The
function signatures in these various layers are updated with new
'sort_keys' and 'sort_dirs' parameters that represent the sort keys
and directions information as lists.
This support is enabled on the v2 API by the existence of a new
'os-server-sort-keys' API extension and is always enabled in the v3
API. The extension API sample issues 2 server creates and then ensures
that both servers are listed (name is unique) in the list reply.
DocImpact: The existing v2 and v3 servers API documentation needs to
reflect these new parameters.
The nova client will also be updated to use these parameters.
Change-Id: I02baf6c3cc7d29abab132ef1726140c57e17d9b6
Partially implements: blueprint nova-pagination
This patch adds API validation schema for volume_attachments.
Update volume required only Volume Id in request body but sample
files used to pass 'device' also.
This patch also correct those API sample files-
doc/v3/api_samples/os-volumes/update-volume-req.json
nova/tests/functional/v3/api_samples/os-volumes/update-volume-req.json.tpl
DocImpact
Partially implements blueprint v2-on-v3-api
Change-Id: I489272528fe4f4c43ab781d6a1a46742b1702c76
This patch ports floating_ips extension from v2 to v2.1,
and have v2 unit test cases shared between v2.1 and v2.
Partially implements blueprint v2-on-v3-api
Change-Id: Ib06c0d6c7ff123f09a99ed94f4b0009695897602
User can specify 'personality' attribute while server creation
& rebuild to inject files into server.
This patch implement this as separate plugin for V2.1 API.
Also define the schema and unit tests for the same.
Partially implements blueprint v2-on-v3-api
Change-Id: Ia0c527539af7fe33eba4999822476653e1b96bc6
API samples and templates of multinic-add-fixed-ip are malformed and
one parameter name is wrong now.
This patch fixes them.
Change-Id: I997584fdcf0b57220280b554ab9da9782d3d0250