38 Commits

Author SHA1 Message Date
Kevin_Zheng
d110ec5961 Updated common create server sample request because of microversion 2.57
Change Ia89eeb6725459c35369e8f790f68ad9180bd3aba added new
microversion 2.57. This microversion removed field 'personality'
from create server request. By default Nova functional api tests use
samples from '/servers' directory to create a server. But now such
requests got 400 Bad Request because of additional 'personality' field.

We must handle this case if we are testing microversions >= 2.57.

This patch will add sample for microversion 2.57+

Change-Id: I8c4e8ffc00ab53f07e7364767f4480abebd2e357
2017-12-14 14:54:31 +08:00
Matt Riedemann
126c3d4c78 Deprecate file injection
This microversion makes the following changes:

1. Deprecates personality files from POST /servers and the rebuild
   server action APIs.
2. Adds the ability to pass new user_data to the rebuild server
   action API.
3. Personality / file injection related limits and quota resources
   are removed from the limits, os-quota-sets and os-quota-class-sets
   APIs.

Implements blueprint deprecate-file-injection

Change-Id: Ia89eeb6725459c35369e8f790f68ad9180bd3aba
2017-12-12 09:22:21 -05:00
LIU Yulong
751f5dec11 Enable reset keypair while rebuilding instance
This patch adds `key_name` param to instance rebuild
API. Then the user could reset the instance keypair
when rebuilding. If set key_name to None, the API
will unset the keypair of the instance.

APIImpact

Implements blueprint: rebuild-keypair-reset

Change-Id: I23886a89c25f811cfbe7e2500ce7ff52f9162966
2017-11-13 10:49:02 +08:00
Kevin_Zheng
b50b5a660e Support tag instances when boot(4/4)
This is the 4th patch of the series,
this patch adds a new microversion
in API to support adding tags when
booting instances.

Implemetes: blueprint support-tag-instance-when-boot

Change-Id: Ifcaaf285c8f98a1d0e8bbbc87b2f57fbce057346
2017-07-17 15:59:42 -04:00
Chris Friesen
90636e0f33 show flavor info in server details
Add a new microversion to change the flavor field in the server
details to display a subset of the flavor information instead of
just a link to the original flavor.

This is more reliable since it shows the actual instance size, while
the flavor may have been deleted/recreated in the meantime or the
flavor extra-specs may have been modified.

Implements: blueprint instance-flavor-api
Change-Id: If646149efb7eec8c90bf7d07c39ff4c495349941
2017-06-02 12:09:24 -04:00
Takashi NATSUME
cbf83a01fb api-ref: Example verification for servers-actions.inc
* Example for the rebuild action

  The functional test is modified and
  the example is replaced with v2.26 examples.

* Example for the rescue action

  The example in API reference is replaced with
  the example with 'rescue_imgae_ref'.

Parameters for the rebuild action and the rescue action
are also fixed.

The patch completes the parameter verification and
the example verification of servers-actions.inc.

Change-Id: Iaf8808b13d1fdfead50da4cd447b3893578f76dd
Implements: blueprint api-ref-in-rst-pike
2017-05-22 00:19:19 +00:00
Takashi NATSUME
5532d6f404 Add a functional test for 'removeFloatingIp' action
Add a functional test for 'removeFloatingIp' action.
Rename the example file for 'addFloatingIp' action
to clarify that it is a request body example.

Change-Id: Ic865318fa640eb17d1317fb3d5f064788ebf44e7
2017-05-08 19:32:53 +00:00
Matt Riedemann
66b0cf3337 2.45: Remove Location header from createImage and createBackup responses
This changes the response for the createImage and createBackup
server action APIs to no longer return a Location header and instead
returns a json dict body with the snapshot image ID. This is done
in a new microversion.

Implements blueprint remove-create-image-location-header-response

Closes-Bug: #1679285

Change-Id: Idc899ee76b8265b1c9e0871b6c7c277424cdd442
2017-04-25 15:52:14 -04:00
libing
e0582bf174 Add server-action-removefloatingip.json file and update servers-actions.inc
Part of bp:api-ref-in-rst-pike

Change-Id: I6a7dbbd5d999fef557a110a6828a317e2e8da3c0
2017-03-31 14:12:38 +00:00
Artom Lifshitz
e80e2511cf Fix tag attribute disappearing in 2.33 and 2.37
In the context of device tagging, bugs have caused the tag attribute
to disappear starting with version 2.33 for block_devices and starting
with version 2.37 for network interfaces. In other words, block
devices could only be tagged in 2.32 and network interfaces between
2.32 and 2.36 inclusively.

This patch documents this behaviour in api-ref and introduces
microversion 2.42, which re-adds the tag in all the right places.

Change-Id: Ia0869dc6f7f5bd347ccbd0930d1d668d37695a22
Closes-bug: 1658571
Implements: blueprint fix-tag-attribute-disappearing
2017-01-30 19:38:46 -05:00
Matt Riedemann
1e4178b6a0 Add functional api_samples test for addFloatingIp action
This is needed for filling the gap in the api-ref docs.

Change-Id: Ib21e4ae25780c1780678074b4ccc5a86944ce992
Related-Bug: #1636185
2016-11-07 11:30:08 -05:00
Jenkins
f5c0b59fd6 Merge "Adding functional tests for 2.3 microversion" 2016-09-07 13:49:56 +00:00
Sarafraj Singh
47b19ffb54 Adding functional tests for 2.3 microversion
Change-Id: Id5cf7ef5c3c7049e36da42f59fd67a61cd3df2d9
Closes-Bug: #1602797
2016-07-27 14:59:28 -05:00
Artom Lifshitz
e83e114e1b Device tagging API support
This patch allows the user to specify a tag for a virtual network
interface and/or block device mapping when booting an instance.

Implements: blueprint bp/virt-device-role-tagging
Change-Id: I89247200f4cf1f644daf476727b4a6acb22b0cf6
2016-06-29 20:55:16 -07:00
Sergey Nikitin
a7aafd99c3 TrivialFix: Remove extra comma from json
JSON standard does not allow trailing comma.
Because of this comma my local tox -e docs failed.
It's strange that it works in gate and check jobs.

Change-Id: I58bf48c248b1722a730667ec7c5e792e6929d2df
2016-06-14 17:35:35 +03:00
Sean Dague
43f69041e9 fix OS-SCH-HNT:scheduler_hints location in sample
OS-SCH-HNT:scheduler_hint is actually a top level attribute, because
of historical accident in the yesteryear of v1 (and thus v2 and
v2.1). One day we should fix this.

Change-Id: I34c105628e274dcc2f8101514f95b9032b2b9f71
2016-06-10 11:37:09 -04:00
ghanshyam
f44d1aff9d Enable all extension for all remaining sample tests
As extensions options has been deprecated, API sample tests
should run against all extension enable.

This commit enables all extensions for all the remaining sample tests
and remove extensions specific tests and sample files.

Also remove extension setting specific logic from base test class
along with TODOs.

Partially implements blueprint api-sample-tests-with-all-extensions

Change-Id: I66b593760789e5b3b92137a672246f8d91e44cba
2016-06-10 06:03:02 +00:00
ghanshyam
08f18502b4 Enable all extension for remaining server API tests
As extensions options has been deprecated, API sample tests
should run against all extension enable.

This commit enables all extensions for remaining server API tests
and remove its specific extensions tests and sample files.

Partially implements blueprint api-sample-tests-with-all-extensions

Change-Id: I3cf5762477b8b77bec4e6cb8f7119c62df7c706a
2016-06-09 08:53:32 -04:00
ghanshyam
f26f18e20c Enable all extension for server API tests part-1
As extensions options has been deprecated, API sample tests
should run against all extension enable.

This commit enables all extensions for server API tests and remove its specific
extensions tests and sample files.

Partially implements blueprint api-sample-tests-with-all-extensions

Change-Id: I7e12a4491738c2908c1dd134c05f38e0db497ee7
2016-06-09 08:53:30 -04:00
ghanshyam
30cfa1db47 Enable all extension for server actions sample tests
As extensions options has been deprecated, API sample tests
should run against all extension enable.

This commit enables all extensions for server actions tests and
remove its specific extensions tests and sample files.

Partially implements blueprint api-sample-tests-with-all-extensions

Change-Id: I88a293958c4c8a1b2c50a837c23bcdda8010e075
2016-06-09 11:13:19 +09:00
Sergey Nikitin
2132cfaa30 Updated common create server sample request because of microversion 2.37
Change I89b18709e0cfbbcbf9be96a91a13a1356cdf85b0 added new
microversion 2.37. This microversion added required field 'networks'
into create server request. By default Nova functional api tests use
samples from '/servers' directory to create a server. But now such
requests got 400 Bad Request because of missed 'networks' field.

We must handle this case if we are testing microversions >= 2.37.

This patch will add sample for microversion 2.37+

Closes-Bug: 1613998

Change-Id: I40cac263c97a4a871072d0efe5ebff295c2d917e
2016-08-22 18:39:35 +03:00
Matt Riedemann
d727795d66 Add REST API support for get me a network
This adds the 2.37 microversion to the REST API for automatically
allocating a network, i.e. get me a network.

The majority of the changes to the REST API concern request
validation. 'networks' is now required in the server POST body
after this microversion. The 'auto' or 'none' special network
uuid values are used, but if specified, can not be specified
with any other requested network values.

The other special case that is checked is when the minimum
compute service version is not new enough to support this change,
i.e. a Mitaka compute will not have the network API code that
knows how to deal with the special auto/none network IDs. Because
the REST API is checking the service version, the service caches
the service version after the first check. Once all computes are
updated to Newton then a restart of the nova-api service(s) will
be required to flush the cache. A release note is provided for
this situation.

The api-ref docs are also updated for this microversion including
an example API sample request.

The matching Tempest change to test this is here:

I89b18709e0cfbbcbf9be96a91a13a1356cdf85b0

The matching python-novaclient change is here:

I6636ddcd3be7bf393d2d69cc6c1ba5c7d65ff674

Implements blueprint get-me-a-network

Change-Id: I89b18709e0cfbbcbf9be96a91a13a1356cdf85b0
2016-08-15 14:10:42 -04:00
ghanshyam
cbd3ec476f Strict ImageRef validation to UUID only
Currently imageRef in server create, rebuild and rescue
operation can be accepted as random url which contains image
UUID and fetch the UUID from that.

As /images proxy APIs are deprecated, and ImageRef in
server creation etc are UUID only and valid against glance.

This patch makes imageRef handling as UUID only and
return 400 if non UUID are requested.

NOTE- Previously nova use to allow the empty string which was
      ok in case of boot from volume.
      We will keep the same behavior of allowing empty string in case of
      boot from volume only and 400 in all other case.

Closes-Bug: #1607229

Change-Id: I49f4da62c1b5b3fd8c5f67039ae113f76722b26c
2016-08-04 02:22:15 +00:00
Sean Dague
0c57f3c4e0 Drop the use of magic openstack project_id
When we put validation into the project_id in urls we had to expand
the default set of allowed values to include 'openstack' and
'fake'. This cleans up all the instances of 'openstack' in the
functional tests, and api samples, and instead uses a constant string
which looks like a real project_id.

We need a stable project_id and not a sentinel otherwise the samples
will be arbitrarily changes on every update.

Change-Id: I1099fd43d2374abd1658b0917765d5375c4b8d1d
2016-03-08 19:34:56 +00:00
Balazs Gibizer
1269f5aeb1 doc: fix malformed api sample
I74b1a340c5ab98fdea2186e87dd13f42ce7c7661 introduced a malformed api
sample and the tox -e docs fails since then. This patch fixes the
sample file.

Closes-bug: #1539071
Change-Id: Ica76db8928fc98db1a09074fdc46439c920e93d8
2016-01-28 14:08:16 +01:00
Ghanshyam
42e4126f05 Enable all extension for server PUT API sample tests
As extensions options has been deprecated, API sample tests
should run against all extension enable.

This commit enables all extensions for server PUT API tests and
remove its specific extensions tests and sample files.

Adding a hack for other tests which are still running with specific
extensions. That is needed to avoid all tests updates in single commit.

Partially implements blueprint api-sample-tests-with-all-extensions

Change-Id: I9c44da3d9df39c1db0948194502be52f4f15acf2
2016-01-28 14:06:36 +09:00
Chuck Carmack
4841cab03e REST API changes for user settable server description
This patches adds changes to the Nova REST API to allow
users to create a server with a description, rebuild
a server with a description, update the description,
and get the description in the server details.

Note: Future commits will be done to support the server
description in python-novaclient and openstack-client.

APIImpact

Implements blueprint: user-settable-server-description

Change-Id: I74b1a340c5ab98fdea2186e87dd13f42ce7c7661
2016-01-25 21:33:30 +00:00
Tang Chen
30c6f49817 Add a REST API to trigger crash dump in an instance.
Change I9b649aafba011d537e3fe4eebef7a678ff6733e4 has added a
compute API to trigger crash dump in instance. This patch adds
the REST API to nova. It enables users to trigger crash dump in
an instance through REST API.

Change-Id: I6ed777ff637254b4b79417008f9055dd19fc7405
Implements: blueprint instance-crash-dump
Co-Authored-By: Hironori Shiina <shiina.hironori@jp.fujitsu.com>
Co-Authored-By: Tang Chen <tangchen@cn.fujitsu.com>
2016-01-20 09:42:50 +08:00
Tomi Juvonen
9345d5835f Add host_status attribute for servers/detail and servers/{server_id}
When a compute service fails, the power states of the hosted VMs are not
updated. A normal user querying his or her VMs does not get any indication
about the failure. Also there is no indication about maintenance.

This change will expose new attribute host_status to user querying his
VMs. Attribute is only seen if policy allows.

DocImpact: This adds API microversion
Implements blueprint get-valid-server-state
APIImpact

Change-Id: I5abea08bdc27624a7f23a7db8964f8c2a7b0eaa7
2016-01-16 20:07:49 +02:00
Sean Dague
f9f3946e0d Use just ids in all request templates for flavors/images
While the API allows for strings which happen to end in an ID for
flavorRef/imageRef, the common path is really just the ID itself, and
we should have the samples do this. The use of full urls in our
samples makes it seem like this is more meaningful than it really is,
and that you could pass a url to a remote system, for instance, which
won't work at all.

Change-Id: I669619b627f954232712d54498b3744353d25451
2015-12-17 13:01:28 -05:00
ghanshyam
3fa2200f0c Share server POST sample file for microversion too
There are many place where server POST request has been used to tests
other API behavior. There was issue of having duplicate
server POST req and resp sample files in each API sample directory.
we added logic to share those sample files from common place
('servers' sample dir)

As microversion tests also need to share such logic, This commit
extends that logic to work for microversion tests also.

Partially implements blueprint test-collapse-v2-and-v21

Change-Id: I3448e1934585c2dabed6c45216ea0513db258b27
2015-08-24 14:40:12 +09:00
He Jie Xu
9f9802eebd Move the v2 api_sample functional tests
This patch move the all v2.1 api sample tests under
'functional/api_sample_tests'. Also move sample files under
'doc/api-samples'.

Co-Authored-By: Ed Leafe <ed@leafe.com>
Co-Authored-By: Alex Xu <hejie.xu@intel.com>
Partial-Bug: #1462901
Change-Id: I2b924f2ad7687a23a018a9b658e8acd9e04d7963
2015-08-18 15:25:41 +08:00
He Jie Xu
3024e16881 Move legacy v2 api smaple tests
This patch moves legacy v2 api sample tests under
'nova/tests/functional/api_sample_tests/legacy_v2'

Also create new API sample test base class for matching new
path in 'nova/tests/functional/api_sample_tests/legacy_v2/ -
api_samples_test_base.py'

Change-Id: Ib455d4fc9d1f9a2a7e9a744f7e63086b3cf49c5e
Partial-Bug: #1462901
2015-08-15 12:30:20 +10:00
ghanshyam
90312d9480 Share admin password func test between 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 admin password functional tests.

In V2.1 os-access-ip is separate plugin where in v2 it was mixed in server
plugin itself. So os-access-ip extension is enabled for v2.1 tests to run
successfully.

Change-Id: Icfb9253ffb0852d15e685045a31b9fe811722733
2015-05-26 10:51:29 +09:00
ghanshyam
072944f454 Merge server metadata tests between 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 servers metadata functional tests.

In V2.1 os-access-ip is separate plugin where in v2 it was mixed in server
plugin itself. So os-access-ip extension is enabled to run
merged functional tests for both v2 and v2.1.

Change-Id: I6726ea5515db0c25e9a9a4356a50ddb03be92541
2015-05-12 10:17:33 +09:00
parklong
83c52f6650 Merge servers-ips 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 servers-ips functional tests.

Change-Id: I60d470997e369154550516d5f02fffb0d846620b
2015-04-29 09:50:54 +08:00
ghanshyam
f713c7c7b5 Merge server tests between 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 servers functional tests.

In V2.1 os-access-ip is separate plugin where in v2 it was mixed in server
plugin itself. So os-access-ip extension is enabled for server tests to run
merged functional tests for both v2 and v2.1.

Change-Id: I3dda5820cf8e1897c7a3895edb43bc708db9073d
2015-04-07 02:05:32 +00:00
ghanshyam
f2cc1bd7bc Move V2 sample files to respective directory
Some sample files like server, images etc are kept under api_samples/
directory.
As plan is to create clean directory structure for sample files for
V2, V2.1 and microversion, moving these sample files to respective directory
will help to achieve that.

Change-Id: I284d035f6fadb26a94bcb3586f4a8c72942ee423
2015-03-11 07:22:36 +00:00