982 Commits

Author SHA1 Message Date
zhangbailin
59156bdf01 Add instance actions v284 samples test
Implements blueprint action-event-fault-details
Change-Id: I8e8a5ca1efe4a3554038dcddc503c3030956e0b9
2020-03-30 03:02:31 +00:00
Zuul
df9195de72 Merge "Non-Admin user can filter their instances by more filters" 2020-03-26 14:29:46 +00:00
Victor Coutellier
4018d6fb71 Non-Admin user can filter their instances by more filters
Microversion bump to allow non-admin user to use more filters key
when listing instances.

In order to stay coherent, all existing instance filters who are
related to a field readable by default to non admin users when showing
instance details, should be allowed by default without policy
modification.

Implements: blueprint non-admin-filter-instance-by-az

Change-Id: Ia66d3a1ceb74ed521cf44922929b2a502f3ee935
2020-03-15 17:35:49 +01:00
Stephen Finucane
f2a438aa9c trivial: Rename directory for os-keypairs samples
We have a custom of naming the directory after the API. Reinforce that
here.

Change-Id: I5bf68aacc1d987400a91467835c4b55f03c18beb
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2020-03-06 16:57:46 +00:00
Zuul
cbcf8183de Merge "api-ref: mark device response param as optional for list/show vol attachments" 2020-03-03 00:23:31 +00:00
Sundar Nadathur
c6365f1b55 Define Cyborg ARQ binding notification event.
APIImpact: Adds 2.82 microversion for /os-server-external-events API.
DocImpact: Adds new version to doc/api_samples/versions/.

Change-Id: I7a626544d8221dc0eeb5672986ca897ce4718be8
Blueprint: nova-cyborg-interaction
2020-03-01 13:52:51 -08:00
Zuul
9a1595c912 Merge "Follow-up: Add delete_on_termination to volume-attach API" 2020-02-20 00:38:42 +00:00
zhangbailin
dcac6825c5 Follow-up: Add delete_on_termination to volume-attach API
Some comment mainly from gmann and takashin in [1] PS15.
Add some tests in test_volumes.py, and fix some docs error.

[1]https://review.opendev.org/#/c/673133/15/nova/tests/unit/api/openstack/compute/test_volumes.py@1902

Depends-On: https://review.opendev.org/#/c/673133/
Part of blueprint support-delete-on-termination-in-server-attach-volume

Change-Id: I8dfa61f03ce927a1e86d42f8fb03bf4cb3e48160
2020-02-19 19:12:21 +00:00
Stephen Finucane
0b1a33ec9c nova-net: Update API reference guide
As highlighted in I77b1cfeab3c00c6c3d7743ba51e12414806b71d2, filtering
either floating IPs or floating IP pools by floating IP name will
actually fallback to filtering by ID. Update the API ref to reflect
this.

Change-Id: I00443ae111cbd1e1ec4d2c2ae1828ddaa095fd1a
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2020-01-22 13:50:30 +00:00
Zuul
1fed6bd934 Merge "Remove 'nova-xvpvncproxy'" 2020-01-08 06:27:03 +00:00
chenxing
2a9766195d [api-ref] Fix the incorrect link
This page[1] doesn't talk about paging or servers_links. The API
reference description should link here[2] for talking about paging.

[1]https://docs.openstack.org/api-guide/compute/links_and_references.html
[2]https://docs.openstack.org/api-guide/compute/paginated_collections.html

Change-Id: I4831d5c2b9598e37346f1e65135b11446b2458eb
Closes-Bug: #1856241
2019-12-24 09:31:38 +08:00
Stephen Finucane
02eb9cffe6 Remove 'nova-xvpvncproxy'
This legacy service is no longer used and was deprecated during the
Stein cycle [1]. It's time to say adios and remove them in their
entirety. This is pretty straightforward, with the sole exception of
schema for the 'remote-consoles' API, which has to continue supporting
requests for type 'xvpvnc' even if we can't fulfil those requests now.

[1] https://review.opendev.org/#/c/610076/

Part of blueprint remove-xvpvncproxy

Depends-On: https://review.opendev.org/695853
Change-Id: I2f7f2379d0cd54e4d0a91008ddb44858cfc5a4cf
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2019-12-23 14:20:28 +00:00
Matt Riedemann
685dc60d58 api-ref: avoid mushy wording around server.image description
This disambiguates the description on the server.image parameter.
If the server is booted from volume (where boot from volume means
there is a bdm with boot_index=0 and destination_type=volume),
then the server.image will be an empty string [1] otherwise it
will be a dict.

[1] 2f0f8b8cf1/nova/api/openstack/compute/views/servers.py (L540)

Change-Id: Ia1ecd39a5636fa5a35cdbcafc03828b2925a9033
2019-12-13 12:39:01 -05:00
Monty Taylor
e7cc5efd20 Keep pre-commit inline with hacking and fix whitespace
The flake8 hook for pre-commit installs its own flake8 which is
not what hacking is pinned to. This results in a bunch of errors.
By doing a local hook we can cause these to be the same.

There are flake8 exclusions in tox.ini that need to be used
in pre-commit. Also we should exclude svg files from the whitespace
modifications, because who cares.

Once those are fixed, running pre-commit -a fixes some whitespace
issues. While the normal use isn't to run -a - if someone does make
a patch that touches any of these they'll get erroneous unrelated
errors compared to their lower work - so fix all of the existing
issues, which are mostly space-at-end-of-line issues it seems.

Change-Id: I78e753492e99c03b30a0a691db3bd75ee3d289c9
2019-12-12 14:56:39 +00:00
Eric Fried
e6f7425444 Nix os-server-external-events 404 condition
The POST /os-server-external-events API had the following confusing
behavior:

With multiple events in the payload, if *some* (but not all) were
dropped, the HTTP response was 207, with per-event 4xx error codes in
the payload. But if *all* of the events were dropped, the overall HTTP
response was 404 with no payload. Thus, especially for consumers sending
only one event at a time, it was impossible to distinguish e.g. "you
tried to send an event for a nonexistent instance" from "the instance
you specified hasn't landed on a host yet".

This fix gets rid of that sweeping 404 condition, so if *any* subset of
the events are dropped (including *all* of them), the HTTP response will
always be 207, and the payload will always contain granular per-event
error codes.

This effectively means the API can no longer return 404, ever.

Closes-Bug: #1855752
Change-Id: Ibad1b51e2cf50d00102295039b6e82bc00bec058
2019-12-09 11:52:49 -06:00
Zuul
c88e7a7430 Merge "Remove 'os-consoles' API" 2019-11-22 21:21:05 +00:00
Stephen Finucane
3062a1199d Remove 'os-consoles' API
This exposes the 'nova-console' service via a REST API, a service that
can only be used with XVP VNC consoles, which in turn require the
'nova-xvpvncproxy' service. We we would like to remove the
'nova-console' and 'nova-xvpvncproxy' services, so start here.

Part of blueprint remove-xvpvncproxy

Change-Id: I2ee3b8c44e5d85e9b3c811ed3c5e6cddc563054f
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2019-11-22 16:09:36 +00:00
Stephen Finucane
e5e477c42a Remove '/os-tenant-networks' REST API
Like '/os-networks', we can't remove this in its entirety due to the
fact that some of these are proxy URLs that also work with neutron.
These are retained but everything else is nuked.

Note that this highlights a bug in the API, whereby a missing
'objects.Network.cidr' value results in a value of 'None' being output
over the API. Clearly this is incorrect, but it's probably not worth
fixing for this deprecated API.

Change-Id: I31cb0891144bdd7945479bb6692b0a533de4c5d0
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2019-11-22 16:03:11 +00:00
Stephen Finucane
1b71252a5f Remove (most) '/os-networks' REST APIs
Drop support for most of the 'os-networks' REST APIs excluding those
that proxy through to neutron.

This API now returns a 410 response for the non-proxy routes.

Unit tests are removed for removed APIs and the functional API sample
tests are just asserting the 410 response now same. The latter are also
expanded to cover APIs that weren't previously tested.

The API sample docs are left intact since the API reference still builds
from those and can be considered more or less branchless, so people
looking at the API reference can apply it to older deployments of nova
before these APIs were removed.

Note: yes, the API samples are correct. It really is a useless API when
used with neutron.

Change-Id: I68bfa77a520382317fc490a4f6c12dd62fc6dcda
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2019-11-18 16:25:47 +00:00
Stephen Finucane
22dee90760 Remove 'os-security-group-default-rules' REST API
This is a nova-network-only API. As with previously removed APIs, this
API now return a 410 response for all routes.

There are some DB methods that were only used by this API. They will be
removed separately in a future change.

Change-Id: Iaa7fb6c548613164d33793822ee85339f9f7fefb
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2019-11-18 16:25:47 +00:00
Zuul
c956a888e6 Merge "Block deleting compute services with in-progress migrations" 2019-11-16 08:28:41 +00:00
Zuul
f8e031beb4 Merge "api-ref: re-work migrate action post-conditions" 2019-11-16 07:48:36 +00:00
Matt Riedemann
92fed02610 Block deleting compute services with in-progress migrations
This builds on I0bd63b655ad3d3d39af8d15c781ce0a45efc8e3a
which made DELETE /os-services/{service_id} fail with a 409
response if the host has instances on it. This change checks
for in-progress migrations involving the nodes on the host,
either as the source or destination nodes, and returns a 409
error response if any are found.

Failling to do this can lead to orphaned resource providers
in placement and also failing to properly confirm or revert
a pending resize or cold migration.

A release note is included for the (justified) behavior
change in the API. A new microversion should not be required
for this since admins should not have to opt out of broken
behavior.

Change-Id: I70e06c607045a1c0842f13069e51fef438012a9c
Closes-Bug: #1852610
2019-11-14 14:29:58 -05:00
Matt Riedemann
2d91a8463f docs: update SUSPENDED server status wrt supported drivers
Two things here:

1. The API guide was missing the hyper-v driver which supports
   the suspend operation. Rather than hard-code a list of supported
   drivers in the doc, this change just links to the entry in the
   feature support matrix.

2. The supported hypervisors mention in the API reference is removed
   because the end user using the API should not need to know or care
   what backend hypervisor on which their server is running. They can
   either suspend or not, but we don't need to mention the supporting
   drivers for that in the API reference.

Change-Id: Ib76779a8e34b2c68b0f4af190f71576180360d0f
Related-Bug: #1815403
2019-11-14 10:25:06 -05:00
Zuul
bd0eab8ff5 Merge ""SUSPENDED" description changed in server_concepts guide and API REF" 2019-11-14 03:08:11 +00:00
Matt Riedemann
6ee0da7e5b api-ref: mark device response param as optional for list/show vol attachments
The 'device' response parameter is not included in
GET /servers/{server_id}/os-volume_attachments or
GET /servers/{server_id}/os-volume_attachments/{volume_id}
when the BDM doesn't have a device_name set, which can be the
case with a volume attached to a shelved offloaded server.
Also, see the logic in _translate_attachment_detail_view
and _translate_attachment_summary_view. This simply marks
the response parameter as optional in those APIs. Since
the parameter is optional, it is sorted to after the required
parameters but before the parameters added in new microversions.

Change-Id: Ifda2f7983f349d51d97e5621cac6c5ad9cb0295f
Closes-Bug: #1818345
2019-11-13 18:44:47 -05:00
Zuul
9fcb0d5def Merge "Add support matrix for Delete (Abort) on-going live migration" 2019-11-13 23:43:52 +00:00
Sharat Sharma
3badb674f6 "SUSPENDED" description changed in server_concepts guide and API REF
The description of "SUSPENDED" server status was misguiding. Rewording
it to make it more accurate.

Change-Id: Ie93b3b38c2000f7e9caa3ca89dea4ec04ed15067
Closes-Bug: #1815403
2019-11-13 17:11:27 +00:00
Matt Riedemann
aa0239f44d api-ref: re-work migrate action post-conditions
This is a follow up to [1] and borrows the same wording
from the resize action post-conditions except uses
"migrate(d)" instead of "resize(d)" where appropriate.

[1] I77830dfb738cd78c830dc3ce7ea88216c1eac7ef

Change-Id: Id24cb48b1b70848d2ce7020d114a843c509ab81c
2019-11-13 10:52:03 -05:00
Kevin_Zheng
70e5c214f0 Add support matrix for Delete (Abort) on-going live migration
The info of Delete (Abort) on-going live migration is missing
in support matrix, it could be useful for users to consider
using this feature.

This patch adds it.

Change-Id: I2f917627fa451d20b1fd1ff35025481a4e525084
Closes-Bug: #1808902
2019-10-30 11:33:07 -04:00
Matt Riedemann
e416b19ba1 api-ref: re-work resize action post-conditions
This change does a few things:

1. Moves the post-condition paragraph into an
   "Asynchronous Postconditions" section like other
   API references.

2. Drops the "RESIZED" VM status wording since what
   that probably meant was the server OS-EXT-STS:vm_state
   value would be "resized" but what was in the reference
   was (a) wrong and (b) redundant with the VERIFY_RESIZE
   status.

3. Re-words and links the resize_confirm_window config
   option wording since saying "if you set" a config option
   in the API reference does not really make sense since
   "you" (the non-admin cloud user) does not have control
   over how the cloud is configured.

Change-Id: I77830dfb738cd78c830dc3ce7ea88216c1eac7ef
2019-10-29 12:56:59 -04:00
Matt Riedemann
d3e38143a7 Add known limitation about resize not resizing ephemeral disks
It's a long known issue that resize does not resize ephemeral
disks attached to the server yet we continue to get bugs about
it and there is no one working on fixing it. As such this change
adds a note to the API reference for the resize server action API
mentioning the known limitation.

Change-Id: I31ca3627f2d3ef5a8db5eecf3759cd304b059963
Related-Bug: #1558880
2019-10-29 12:50:13 -04:00
Dan Smith
3391298706 Add image caching API for aggregates
This adds a new microversion and support for requesting image pre-caching
on an aggregate.

Related to blueprint image-precache-support

Change-Id: I4ab96095106b38737ed355fcad07e758f8b5a9b0
2019-10-15 21:22:31 -04:00
zhangbailin
ac165112b7 Filter migrations by user_id/project_id
In microversion 2.80, the ``GET /os-migrations`` API will have
optional ``user_id`` and ``project_id`` query parameters for
filtering migrations by user and/or project:

* GET /os-migrations?user_id=ef9d34b4-45d0-4530-871b-3fb535988394
* GET /os-migrations?project_id=011ee9f4-8f16-4c38-8633-a254d420fd54
* GET /os-migrations?user_id=ef9d34b4-45d0-4530-871b-3fb535988394&project_id=011ee9f4-8f16-4c38-8633-a254d420fd54

And expose the ``user_id`` and ``project_id`` fields in the following APIs:

* GET /os-migrations
* GET /servers/{server_id}/migrations
* GET /servers/{server_id}/migrations/{migration_id}

Co-Authored-By: Qiu Fossen <qiujunting>
Part of blueprint add-user-id-field-to-the-migrations-table
Change-Id: I7313d6cde1a5e1dc7dd6f3c0dff9f30bbf4bee2c
2019-10-14 11:35:11 -07:00
Takashi NATSUME
a7c3108bf7 api-ref: Fix security groups parameters
The security groups parameters are optional
in the response of the following APIs.

- GET /servers/detail
- GET /servers/{server_id}
- PUT /servers/{server_id}
- POST /servers/{server_id}/action (rebuild)

So fix them.

Change-Id: Icc2315fd8b8c085de9d560de6ddf4c05aaaf6acb
Closes-Bug: #1846656
2019-10-07 10:25:02 +09:00
Matt Riedemann
59f4dd40f8 api-ref: fix server topology "host_numa_node" field param name
The actual parameter in the response of the API is "host_node"
without "numa" in it so this fixes the docs to match the code
and sample.

Change-Id: Ie562d47e0fa7414bcdccf407b79e71e1aae8d708
Closes-Bug: #1843098
2019-09-06 17:31:42 -04:00
zhangbailin
e5b47543cf Add delete_on_termination to volume-attach API
Add the 'delete_on_termination' field to the volume attach API to support
configuring whether to delete the data volume when the instance is destroyed.

To avoid upgrade impact issues with older computes, the
'delete_on_termination' field is set in the API rather than when the BDM
is created in the compute service.

Implements: blueprint support-delete-on-termination-in-server-attach-volume
Change-Id: I55731b1822a4e32909665a2872d80895cb5b12f7
2019-09-05 20:54:56 +08:00
Yongli He
3dcb404b1f Add server sub-resource topology API
Add a new server topology API to show server NUMA information:
  - GET /servers/{server_id}/topology

Add new policy to control the default behavior:
  - compute:server:topology:index
  - compute:server:topology:host:index

Change-Id: Ie647ef96597195b0ef00f77cece16c2bef8a78d4
Implements: blueprint show-server-numa-topology
Signed-off-by: Yongli He <yongli.he@intel.com>
2019-08-30 10:04:56 +08:00
zhangbailin
27b6c18c66 Specify availability_zone to unshelve
This adds support, in a new microversion, for specifying an availability
zone to the unshelve server action when the server is shelved offloaded.

Note that the functional test changes are due to those tests using the
"latest" microversion where an empty dict is not allowed for unshelve
with 2.77 so the value is changed from an empty dict to None.

Implements: blueprint support-specifying-az-when-restore-shelved-server
Closes-Bug: #1723880

Change-Id: I4b13483eef42bed91d69eabf1f30762d6866f957
2019-08-27 12:57:10 -04:00
Ghanshyam Mann
f7e672d302 Update api-ref for 2.75 to add config_drive in server update response
In 2.75, we missed to add the config_drive field in api-ref for
update server response
- I9d257a003d315b84b937dcef91f3cb41f3e24b53.

This commit updates the api-ref.

Change-Id: I46ab0b8650bf50a5384bb56027cdf0dc2a9bb2fe
Partial-Implements: blueprint api-consistency-cleanup
2019-08-20 12:58:36 +00:00
Matt Riedemann
ad75beee11 api-ref: add config_drive to 2.75 rebuild response parameters
Change I9d257a003d315b84b937dcef91f3cb41f3e24b53 and the 2.75
microversion returns the config_drive parameter in the rebuild
response and it's in the 2.75 rebuild response sample but was
missing from the response parameters table.

Change-Id: I89eca8638bc0d64b7f320f4ec5c49375bfebdb56
2019-08-19 15:01:35 -04:00
Zuul
35485eacfb Merge "API microversion 2.76: Add 'power-update' external event" 2019-08-15 23:39:50 +00:00
Surya Seetharaman
62f6a0a1bc API microversion 2.76: Add 'power-update' external event
This patch adds a new external event called "power-update"
through which ironic will convey all (power_off and power_on)
power state changes (running -> shutdown or shutdown -> running
will be the only ones handled by nova and the rest will be ignored)
on a physical instance to nova. The database will be updated
accordingly to reflect the real vm_state and power_state of the
instance. This way nova will not be able to enforce
an incorrect power state on the physical instance during
the periodic "sync_power_states" task.

Implements blueprint nova-support-instance-power-update
Story: 2004969
Task: 29423

Change-Id: I2b292050cc3ce5ef625659f5a1fe56bb76072496
2019-08-15 13:19:44 -04:00
Takashi NATSUME
abfb28291a api-ref: Fix collapse of 'host_status' description
Fix collapse of 'host_status' description in the follwoing APIs
in the compute API reference.

- PUT /servers/{server_id}
- POST /servers/{server_id}/action (rebuild)

Change-Id: I003f9a81ac6f7e0ec13a24db3fda1b7ff6612bc5
Closes-Bug: #1840094
2019-08-14 10:46:26 +09:00
Ghanshyam Mann
b26bc7fd7a Multiple API cleanup changes
This microversion implements below API cleanups:

1. 400 for unknown param for query param and for request body.

2. Making server representation always consistent among all APIs
   returning the complete server representation.

3. Change the default return value of ``swap`` field from the empty string
   to 0 (integer) in flavor APIs.

4. Return ``servers`` field always in the response of GET
   hypervisors API even there are no servers on hypervisor

Details: https://specs.openstack.org/openstack/nova-specs/specs/train/approved/api-consistency-cleanup.html

Partial-Implements: blueprint api-consistency-cleanup

Change-Id: I9d257a003d315b84b937dcef91f3cb41f3e24b53
2019-08-12 08:52:38 -05:00
Zuul
4f26ab0657 Merge "Retrun 400 if invalid query parameters are specified" 2019-08-09 23:50:19 +00:00
Matt Riedemann
ebd68b3d1e api-ref: document valid GET /os-migrations?migration_type values
There are only four valid values for the migration_type filter
when listing migrations so let's document them for the request
parameter. Note that the API jsonschema validation does not
restrict the values since the filter parameter pre-dated jsonschema
validation for query parameters. Specifying an invalid value would
just result in no results from the DB query.

Change-Id: I7fee254edefd524633af62d80cb47009b1cf010b
2019-08-06 18:40:48 -04:00
Takashi NATSUME
ae7ebdf45e Retrun 400 if invalid query parameters are specified
The following APIs return 500 error currently
if an invalid sort key or an invalid sort direction
query parameter is specified.

- GET /flavors
- GET /flavors/detail

Make the APIs return 400 error in that case.

Change-Id: I1d6d2c1f734b28dbea5c67cf88717149dd4911d7
Closes-Bug: #1835925
2019-08-04 23:59:51 +00:00
Zuul
d358df32f7 Merge "api-ref: touch up the os-services docs" 2019-07-25 19:25:27 +00:00
Matt Riedemann
af2e5a5755 api-ref: touch up the os-services docs
Make it clear that the first GET /os-services response sample
is for 2.11 and make the version suffix format for the 2.69
example match the other response examples, i.e. "(v2.x)".

Also mention that PUT /os-services/{service_id} only allows
nova-compute services. Before Pike it was possible to update
non-nova-compute services though it didn't really make sense.

Change-Id: I585582710884a53d91f4453011d3407a94efe1e3
2019-07-25 11:48:53 -04:00