Commit Graph

455 Commits

Author SHA1 Message Date
liyingjun ec53c6c0ec Microversion 2.33 adds pagination support for hypervisors
When there are thousands of compute nodes, it would be slow to get the
whole hypervisor list, and it is bad for user experience to display
thousands of items in a table in horizon. This patch is proposed to
support pagination for hypervisor by adding `limit` and `marker` to
the list api.

Implements blueprint: pagination-for-hypervisor

Change-Id: Ie7f8b5c733b383f3e69fa23188e56257e503b5f7
2016-07-01 08:47:50 +08:00
Jenkins 7ffb5aac90 Merge "api-ref: Example verification for os-agents.inc" 2016-06-30 23:10:16 +00: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
Takashi NATSUME ba71b8d9ab api-ref: Example verification for os-agents.inc
Currently only 'xen' is supported for the 'hypervisor'
parameter. So examples are changed to 'xen'
instead of 'hypervisor'.

Change-Id: Ibd40dcfd3801c7a4165e299a1232ea46f2f17cf4
Implements: blueprint api-ref-in-rst
2016-06-27 21:29:26 +09:00
Jenkins 491613e3f3 Merge "Fix ConsoleAuthTokens to work for all console types" 2016-06-24 15:58:21 +00:00
Radoslav Gerganov 3c3925e71a Fix ConsoleAuthTokens to work for all console types
The current API allows getting connection info only for tokens which
correspond to RDP consoles. It should work for all types of tokens. This
patch introduces a new microversion which fixes this problem.

APIImpact

blueprint fix-console-auth-tokens

Change-Id: I27a65e0cd8b5eb51ecdc84cbf310ae107ff131dc
2016-06-22 17:11:09 +03:00
Takashi NATSUME a7cbc90fb1 api-ref: Improve os-instance_usage_audit_log samples
Improve api samples for os-instance_usage_audit_log
and fix a parameter.

Change-Id: I8436a6ab0610e41d8c6c95c55a263fdfbbf58476
Implements: blueprint api-ref-in-rst
2016-06-21 20:30:11 +09:00
Jenkins 2b0557e4ee Merge "Added missed response to test_server_tags" 2016-06-16 01:51:55 +00: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
Sergey Nikitin 15a94581a6 Added missed response to test_server_tags
Also other server tags templates were modified
to improve future api ref docs.

Change-Id: Idab0328f9cdbe0d85880209a2b22ffc7df2201a0
2016-06-14 17:06:47 +03:00
Sean Dague d8673cb256 remove processing of blacklist/whitelist/corelist extensions
This removes the facility in the API router to have limited lists of
extensions. From this point forward, what is in Nova is loaded, no
exceptions.

A number of unit tests and fakes have to be updated to pass after
this, as many unit tests were sending small lists of extensions to the
API router to simplify the responses they were getting back. This also
required stubbing out the request db cache in some cases, because
extensions later get content from there to avoid additional db
hits. As well as adjusting a few samples tests which now return more
data because all the extensions are always loaded.

There is much cleanup to happen after this, but this is the smallest
unit to get us over this boundary which will start letting us to
refold extensions back into the base views (and massively simplify the
API code).

This does not yet remove the config options because there is another
place those get used in servers.py and the testing fallout of that is
much bigger.

The reno will come with that patch.

Change-Id: I3e72f5e23ce39148f31dfdb76d18f403c6d04842
2016-06-10 11:37:09 -04: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
ghanshyam 8291e5e247 Enable all extension for Flavor API sample tests
As extensions options has been deprecated, API sample tests
should run against all extension enable.

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

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

Change-Id: I9fc496a6a05f794a31b0b361cc98d2f4b2f79818
2016-06-09 10:25:21 +09:00
Sylvain Bauza 7aa2285e72 API change for verifying the scheduler when live migrating
After modifying the evacuate action, we now add a new microversion
change for modifying the live-migrate call so that the scheduler is
called when the admin user provides an hostname unless the force
field is provided.

APIImpact

Implements: blueprint check-destination-on-migrations-newton

Change-Id: I212cbb44f46d7cb36b5d8c74a79065d38fc526d8
2016-06-06 11:44:06 +02:00
Sylvain Bauza 86706785ff API change for verifying the scheduler when evacuating
Adding a new microversion for changing the evacuate action behaviour
to call the scheduler anyway unless the admin user provides a force
flag that then keeps the previous behaviour by forcing the conductor
to call the destination without verifying it.

Implements: blueprint check-destination-on-migrations

APIImpact

Change-Id: I9ecbe3d481bf17b12072511da4bb106ff1b6404e
2016-06-02 15:03:39 +02:00
Pavel Kholkin 228e916cdd Microversion 2.28 changes cpu_info string to JSON object
After this microversion Nova API the GET request to
/v2.1/os-hypervisors/{hypervisor_id} responses cpu_info
as regular JSON object instead of string.

Implements blueprint nova-api-hypervsor-cpu-info

Change-Id: I14db9017f69e70e759cc80d031f76af8be179e45
2016-06-01 16:25:17 +00:00
Takashi NATSUME 3838f9cd7f api-ref: Add a sample test for os-interface
In order to add an example creating an interface with
net_id and fixed_ips, add the sample test for it.

Change-Id: I6b2567db82d000e4b1cdf46020ce1b57103c3f46
Implements: blueprint api-ref-in-rst
2016-05-27 12:48:36 +00:00
Chris Dent bd199e3f9b Support for both microversion headers
In this change the new OpenStack-API-Version headers is allowed,
but not required, for requesting a microversion.

Both headers are accepted in the request and both headers are sent in
the response (both the header and its value, and the addition to the Vary
header).

Many tests which explicitly use a microversion header have been
updated to use both. This change is not 100% as most of the tests
are testing the handling of the value of the header, not which
header is involved.

Partially-Implements: blueprint modern-microversions
Change-Id: I68da13b5ba0c2f3357523e765a5b9db81899daf1
2016-05-25 21:41:27 +00:00
He Jie Xu 2f4f098c64 Add api-sample test for showing quota detail
The method of showing quota detail is missing the api sample test.
This patch adds that.

Part of bp:api-ref-in-rst

Change-Id: I943af1d856f890eab4c34674d251f698ee84a836
2016-05-09 10:49:22 +08:00
He Jie Xu 73eda1cb7d Remove the legacy v2 API test scenarios from API sample tests
This patches from the test scenarios for the legacy v2 from API
sample tests. There still have some codes for legacy v2 which should
be cleanup, but that can be done later patches. This patch just stop
the test on the legacy v2 API.

Partially implements blueprint remove-legacy-v2-api-code

Change-Id: I38626e5a4aa98cbfd7b65b5eb0edbcae96e5b3f2
2016-05-04 15:49:52 +08:00
Jenkins fc1b48380b Merge "Add functional test for v2.7" 2016-04-21 13:27:34 +00:00
srushti 3e527265b6 Fix invalid uuid warnings in api testcases
Currently, unit testcases of api emit FutureWarnings
from oslo.versionedobjects about invalid uuids as documented here[1].

This commit changes these tests to use valid uuids so
that when they are run these warnings are no longer emitted.

Made changes to project_id in fakes.py to use valid project_id
which removes warnings related to invalid uuids in testcases.

Also made changes to project_id in JSON headers to use valid
uuids in functional testcases same as that in unit testcases.

[1] http://docs.openstack.org/developer/oslo.versionedobjects/api/fields.html#oslo_versionedobjects.fields.UUIDField

Partial-Bug: #1557378
Change-Id: I5f69a2c3dc4d0279aed11750e6758b624debb64f
2016-04-12 07:31:15 +00:00
Sean Dague 78307643ac allow samples testing for PUT to not have a body
Previously all testing of the PUT method assumed that a body existed,
which is implied by the HTTP spec, but not strictly stated. The tags
api-wg spec specifies an interface with tags that uses PUT with no
payload.

This makes our _do_put able to handle that case, and removes empty
templates when not needed.

Change-Id: I3d869d63affd08e321944c0082ee9865124d38e2
2016-04-07 09:31:12 -04:00
Sergey Nikitin 537df23d85 Added server tags support in nova-api
Added new API microversion which allows the following:
- add tag to the server
- replace set of server tags with new set of tags
- get information about server, including list of tags for server
- get just list of tags for server
- check if tag exists on a server
- remove specified tag from server
- remove all tags from server
- search servers by tags

DocImpact
APIImpact

Implements: blueprint tag-instances

Change-Id: I9573aa52aae9f49945d8806ca5e52ada29fb087a
2016-04-06 16:38:21 +03:00
jichenjc fc164e3908 Add functional test for v2.7
microversion v2.7 was added without a functional test,
even though we can cover most cases in unit test
for negative case, it would be better to
have a functional test for a specific microversion API change.

Change-Id: I4d5576cc4ebcdeaa4e4f067fe9c6207280ad7eda
2016-03-20 19:59:24 +08: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
Jenkins 7e3e92e826 Merge "Update time is not updated when metadata of aggregate is updated" 2016-03-04 14:10:57 +00:00
Eli Qiao f18a46c072 API: Improve os-migrateLive input parameters
This is os-migrateLive API changes:

    * 2.25 - Make block_migration to support 'auto' value, remove
             disk_over_commit.

Partially implements: blueprint making-live-migration-api-friendly
APIImpact
DocImpact
Change-Id: Ibb0d50f0f7444028ef9d0c294aea41edf0024b31
2016-02-29 17:44:17 +00:00
Pallavi b4f7066e7c Update time is not updated when metadata of aggregate is updated
For example, When aggregate zone is updated, time is not getting updated
in updated_at field.

So, modified the code such that time gets updated in updated_at field
whenever the aggregate metadata content gets modified.

Change-Id: Icb65313ba85562fadeddbc1890ca5d463e74d3c2
Closes-Bug: #1538014
2016-02-29 16:59:10 +05:30
Andrea Rosa fa00292546 Abort an ongoing live migration
This change adds a DELETE call on the server-migrations object to cancel
a running live migration of a specific instance.
TO perform the cancellation the virtualization driver needs to support
it, in case that the feature is not supported we return an error.
We allow a cancellation of a migration only if the migration is
running at the moment of the request and if the migration type is equal
to 'live-migration'.
In this change we implement this feature for the libvirt driver.
When the cancellation of a live migration succeeded we rollback the live
migration and we set the state of the Migration object equals to
'cancelled'.
The implementation of this change is based on the work done by the
implementation of the feature called 'force live migration':
https://review.openstack.org/245921

DocImpact
ApiImpact

Implements blueprint: abort-live-migration
Change-Id: I1ff861e54997a069894b542bd764ac3ef1b3dbb2
2016-02-26 15:11:41 +00:00
ShaoHe Feng 98e4a64ad3 Add new APIs and deprecate old API for migrations
This patch does two things:
1. Add two APIs /servers/migrations:index/show for server migrations.
Two new novaclient commands server-migration-list and
server-migration-show will also be added.
ref: I071198fa9ba0699383bdebf4fab54714a435e6c3

2. Add ref link for /os-migrations
The old top-level resource `/os-migrations` won't be extended anymore.
It is deprecated.
Adding migration_type for it, also add ref link to
/servers/{uuid}/migrations/{id} for it when the migration is an
in progress migration.

Partially implements blueprint live-migration-progress-report

Change-Id: Ia92ecbe3c99082e3a34adf4fd29041b1a95ef21e
Co-authored-by: ShaoHe Feng <shaohe.feng@intel.com>
2016-02-26 14:25:48 +00:00
Pawel Koniszewski c9091d0871 Add new API to force live migration to complete
This change adds manual knob to force ongoing live migration to
complete. It is implemented as a new server-migrations API.

DocImpact
ApiImpact

Implements: blueprint pause-vm-during-live-migration
Change-Id: I034b4041414a797f65ede52db2963107f2ef7456
2016-02-08 08:59:52 +01:00
Mark Doffman 934a0e4ede Make os-instance-action read deleted instances.
Add a microversion change to the os-instance-actions API so that we
mutate the context to set 'read_deleted="yes"' when looking up the
instance.

Blueprint: os-instance-actions-read-deleted-instances
Change-Id: I607a28bbe06e20e17ee47a283e06b1d42b5c0e84
2016-02-05 07:59:52 -05:00
Jenkins 749cc08372 Merge "Enable volume operations for shelved instances" 2016-02-05 03:29:21 +00:00
Andrea Rosa cf34a32820 Enable volume operations for shelved instances
This change enables the attach and detach volume operations for
instances which are in shelve and shelved_offloaded state.
The code to manage the actual attach and detach is implemented by this
change: https://review.openstack.org/259528
New tempest tests are going to be written for testing the new feature.

APIImpact
DocImpact by this change we are allowing operations which were not
allowed before, we need to track this change in the documentation.

Partially implements blueprint: volume-ops-when-shelved

Change-Id: I43b67a50d998d43a6ff78c917093c513231b6ff2
2016-02-03 17:51:26 +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
Sean Dague 1f16a763e7 Make project_id optional in v2.1 urls
This introduces microversion 2.18 which signals that the {project_id}
is no longer required in URLs.

It tests this with an additional scenario in api_samples which makes
all the requests without the project_id in the url (using a different
noauth middleware to accomplish this).

Update the link fixer in the ApiSamples matching code to also update
for optional project_id. This is the least worse approach here,
because if we set request_api_version, then we have to duplicate the
entire template tree as well, which we definitely don't want to do, as
it now correctly handles either url form.

This updates the auth tests to bifurcate with testscenarios instead of
the subclass model, which makes for more consistent tests.

In order to support adding routes without project_id we have to be
able to restrict project_id something that doesn't match any of our
top level routes.

The default for this is [0-9a-f\-]+ which will match all of the
following:

 - keystone default generated project_ids [0-9a-f]{32}
 - integer project_ids (\d+) - known in use by RAX
 - uuids with dashes (no known users, but suspect there might be)

This can be overrided with the new (but already deprecated)
``project_id_regex`` config option.

NOTE: we used this feature to expand the regex to match 'fake' and
'openstack' as valid project ids in tests. Those concepts are deeply
embedded in our tests, and need to be unwound independently.

APIImpact

Implements bp:service-catalog-tng

Co-Authored-By: Augustina Ragwitz <auggy@cpan.org>
Change-Id: Id92251243d9e92f30e466419110fce5781304823
2016-01-24 06:38:15 -05:00
Jenkins 833face153 Merge "Add a REST API to trigger crash dump in an instance." 2016-01-22 23:45:08 +00:00
Jenkins 8101d14625 Merge "ServerGroupsV213SampleJsonTest should actually test v2.13" 2016-01-22 11:12:55 +00:00
Ken'ichi Ohmichi 7608b430cc Fix indents of servers-detail-resp.json
servers-detail-resp.json of microversion v2.16 contains some invalid
indents which are made with tabs instead of spaces.
This patch fixes them by replacing with spaces.

Change-Id: I1ee55e7b8ec78bde1d2e6097585b8d3db07d68f2
2016-01-20 23:37:34 +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
Matt Riedemann 0875a411aa ServerGroupsV213SampleJsonTest should actually test v2.13
This API samples test was not using testscenarios properly,
and it wasn't extending the correct test class, so it was:

1. Not actually running tests.
2. Not running tests at the correct microversion (v2.13).

This fixes the testscenarios setup for the subclass and the
API samples and templates (since it's not using subs for the
intended project_id that was in the samples).

Also fixes a typo in ApiSampleTestBaseV21.

Change-Id: I27e8fce5d456914d88098c6cfabe05fa8afbc8eb
Closes-Bug: #1534354
2016-01-14 14:48:40 -08:00
Balazs Gibizer 1c30edc5b2 api: add soft-affinity policies for server groups
Allows soft-affinity and soft-anti-affinity to be used as a policy
for the server group api extension. Add soft policies
to the JSONSchema, which validates server group definitions.
Bump API microversion to 2.15.

Implements: blueprint soft-affinity-for-server-group
Change-Id: I376bdba7df1344d269aa126f4896610baf2e16a2
2016-01-07 10:43:57 +01:00