Commit Graph

334 Commits

Author SHA1 Message Date
Jenkins a25f3c6c2e Merge "Merge flavor_manage functional tests of v2 and v2.1" 2015-04-15 00:10:55 +00:00
parklong 5fb5170adf Merge flavor_manage functional tests of v2 and v2.1
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 merges flavor_manage functional tests.

This commit also tags FlavorManageSampleJsonTests as ADMIN_API to avoid
AuthenticationException when create a test flavor

Change-Id: I5fe68870285cfee2b3254184209a7111b24f7223
2015-04-03 16:55:29 +08:00
He Jie Xu 8423a9cd15 Add json-schema for v2.1 fixed-ips
This patch adds json-schema for v2.1 fixed-ips. The json-schame limits
the input for actions reserve/unreserve. Also fixed the API sample
file at same time and add parameter_type none.

Co-Authored-By: Ken'ichi Ohmichi <ken1ohmichi@gmail.com>
Change-Id: Id2d0416c3ccc2a50d3cb66bed8747082f98fb194
Closes-Bug: #1438480
2015-04-01 18:39:16 +08:00
ghanshyam e8006761d7 Fix v2.1 list-host to remove 'services' filter
In v2.1, list-host supports 'services' filter also
But this is not case with v2 API. v2 list-host does not support
'services' filter.
v2.1 APIs should be same as v2 in all cases/scenarios.

This is bug fix so not putting as microversions, its just a change to
the v2.1 code so it is equivalent to v2. If later needed then, this can
be reverted back as current ways via microversion.

This was no best test coverage to catch this kind of issue.
This was caught while merging the v2 and v2.1 tests
- Ibd53a7ddd4792942fe2dc45121dcc25fc9864903

Change-Id: I11210babde0c5a668c794cd6aae7eb8c5093a99c
Closes-Bug: #1437184
2015-03-27 17:20:58 +09:00
ghanshyam 7f5462777b Fix v2.1 hypervisor servers to return empty list
In v2.1, os-hypervisors/servers API returns empty servers list in
case where hypervisors does not have any servers.

But this is not case with v2 API. v2 API does not put 'servers' field
in response if it is empty.

v2.1 APIs should be same as v2 in all cases/scenarios.

This is bug fix so not putting as microversions, its just a change to
the v2.1 code so it is equivalent to v2. If later needed then, this can
be reverted back as current ways via microversion.

This was no best test coverage to catch this kind of issue.
This was caught while merging the v2 and v2.1 tests
- I5ddf3c54dd80a67f71762769d6130db41e772b01

Change-Id: I32e5cde65baeca71ec06b814b7db7aa7469eac64
Closes-Bug: #1435668
2015-03-24 23:54:23 +00:00
Jenkins 8601f1ef4f Merge "Merge V2 and V2.1 functional tests" 2015-03-23 23:18:21 +00:00
ghanshyam e24c2239fb Merge V2 and V2.1 functional tests
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
2015-03-23 17:27:55 +09:00
Davanum Srinivas ae3c635020 Fix docs build break
fix 2 bad json files to get the docs build to succeed.

Closes-Bug: #1434855
Change-Id: I600f5e83bdaf254bcebbd232ec4a2d396041ceb3
2015-03-21 13:23:08 -04:00
ghanshyam 2f32996c3e V2.1 tests - Reuse server post req/resp sample file
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
2015-03-11 15:59:52 +09:00
Alexandre Levine abc656d3d5 Add info for Standalone EC2 API to cut access to Nova DB.
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
2015-03-05 19:19:23 +04:00
Jenkins 854d95ec11 Merge "Adds keypair type in nova-api" 2015-03-05 14:41:07 +00:00
Chris Yeoh c836f425bc Adds keypair type in nova-api
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
2015-03-04 22:16:37 +00:00
ghanshyam e74b62f26f Remove extended addresses from V2.1 update & rebuild
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
2015-03-04 16:08:02 +09:00
Jenkins 064849bcf0 Merge "Disables pci plugin for v2.1 & microversions" 2015-03-03 14:33:58 +00:00
Chris Yeoh 45591b6da1 Disables pci plugin for v2.1 & microversions
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
2015-03-03 14:20:42 +10:30
He Jie Xu 7007ab20f6 Remove attach/detach/swap from V2.1 extended_volumes
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
2015-03-01 12:30:52 +08:00
Jenkins cd845661bc Merge "Remove OS-EXT-IPS attributes from V2.1 server ips" 2015-02-27 20:42:05 +00:00
Jenkins 165d37c963 Merge "Remove 'locked_by' from V2.1 extended server status" 2015-02-27 20:41:35 +00:00
Jenkins 92b0adad39 Merge "Remove 'id' from V2.1 update quota_set resp" 2015-02-27 20:41:00 +00:00
Jenkins afc2e675d7 Merge "API: Change the API cpu_info to be meaning ful." 2015-02-27 05:32:02 +00:00
ghanshyam 6931bedb9e Remove OS-EXT-IPS attributes from V2.1 server ips
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
2015-02-27 13:14:00 +09:00
ghanshyam 8f98f8205b Remove 'locked_by' from V2.1 extended server status
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
2015-02-27 10:32:32 +09:00
ghanshyam e511410188 Remove 'id' from V2.1 update quota_set resp
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
2015-02-27 01:10:38 +00:00
ghanshyam 1c29a25ca5 Remove accessips attribute from V2.1 POST server resp
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
2015-02-26 07:00:40 +00:00
yunhong jiang ab437c0e90 API: Change the API cpu_info to be meaning ful.
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
2015-02-24 13:57:49 -08:00
Jenkins 3f33e76d19 Merge "Implement api samples test for os-baremetal-nodes Part 2" 2015-02-16 14:32:24 +00:00
Jenkins 1fbca42d27 Merge "Implement api samples test for os-baremetal-nodes" 2015-02-12 14:27:01 +00:00
Chris Yeoh 9b794005fe Implement api samples test for os-baremetal-nodes Part 2
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
2015-02-11 14:48:53 +10:30
Chris Yeoh e11a6de1d9 Implement api samples test for os-baremetal-nodes
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
2015-02-10 22:06:18 +10:30
Chris Yeoh 9631e4836a Extract preserve ephemeral on rebuild from servers plugin
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
2015-02-09 21:36:53 +10:30
Chris Yeoh c99d8f32b2 Change some v2.1 extension names to v2
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
2015-02-09 09:56:30 +10:30
Chris Yeoh 30ed3064ab Convert v2.1 extension_info to show V2 API extension list
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
2015-02-09 09:52:32 +10:30
Ken'ichi Ohmichi 569d62716d Remove v1.1 from v2.1 extension description
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
2015-02-05 07:44:38 +00:00
Chris Yeoh f1499e715d Add missing setup.cfg entry for os-user-data plugin
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
2015-02-05 17:15:54 +10:30
Davanum Srinivas aff3e8699a Cleanup bad JSON files
- 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
2015-01-22 11:46:05 -08:00
Jenkins 6ccf12c8c0 Merge "Cleanup in admin_actions(v2.1api)" 2015-01-15 05:59:51 +00:00
Eli Qiao 89c57a1c91 Cleanup in admin_actions(v2.1api)
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
2015-01-13 17:31:23 +00:00
Jenkins 5d3d96c4b0 Merge "Make rebuild server schema 'additionalProperties' False" 2015-01-05 17:19:45 +00:00
ghanshyam 340ffeeff1 Make rebuild server schema 'additionalProperties' False
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
2015-01-05 11:33:51 +09:00
ghanshyam 5ba9301c34 Make create server schema 'additionalProperties' False
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
2014-12-15 15:00:11 +09:00
Eli Qiao 001d702e90 Modify v21 alias name for compatible with v2
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
2014-12-09 12:57:36 +08:00
Jenkins 45cc1a79fc Merge "Convert v3/v2.1 extension info to present v2 API format" 2014-12-05 11:32:05 +00:00
Chris Yeoh bb38d13c69 Convert v3/v2.1 extension info to present v2 API format
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
2014-12-04 19:27:50 +08:00
Jenkins 2a2f36a56a Merge "Add API validation schema for volume_attachments" 2014-12-04 03:44:27 +00:00
Jenkins 1277c12209 Merge "Fix API samples/templates of multinic-add-fixed-ip" 2014-12-02 13:05:15 +00:00
Jenkins 289736bfcf Merge "Port virtual-interfaces plugin to v2.1(v3) API" 2014-12-02 07:01:28 +00:00
Jenkins d2298c6433 Merge "GET servers API sorting REST API updates" 2014-12-02 06:18:09 +00:00
Jenkins 8425fbc01c Merge "Implement 'personality' plugin for V2.1" 2014-12-01 14:29:14 +00:00
jichenjc 7ffdb2deaf Port virtual-interfaces plugin to v2.1(v3) API
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
2014-12-01 11:04:08 +08:00
Steven Kaufer f268be97bd GET servers API sorting REST API updates
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
2014-12-01 02:47:02 +00:00