Commit Graph

455 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
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
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
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] https://github.com/openstack/nova/blob/2f0f8b8cf13b7441ce6a7a524b33d30d40f1d468/nova/api/openstack/compute/views/servers.py#L540

Change-Id: Ia1ecd39a5636fa5a35cdbcafc03828b2925a9033
2019-12-13 12:39:01 -05: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 bca4fdec9a Merge "Correct project/user id descriptions for os-instance-actions" 2019-07-25 08:58:05 +00:00
Zuul ab34c941be Merge "Remove deprecated Core/Ram/DiskFilter" 2019-07-23 23:36:06 +00:00
Stephen Finucane 78645e61c6 Remove deprecated Core/Ram/DiskFilter
These were deprecated during Stein [1] and can now be removed, lest they
cause hassle with the PCPU work. As noted in [1], the aggregate
equivalents of same are left untouched for now.

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

Change-Id: I8a0d332877fbb9794700081e7954f2501b7e7c09
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2019-07-23 07:49:41 -07:00
qiufossen 6b3aa31458 Correct project/user id descriptions for os-instance-actions
The 'user_id' and 'project_id' parameter descriptions for server actions
imply that they are the value of the user/project that owns the server,
but that is incorrect - they are the project/user id of whoever made the
request/initiated the action.

The existing project_id_instance_action parameter variable, which is only
used by the os-cloudpipe reference, is renamed to avoid confusion with
instance actions.

Co-Authored-By: Brin Zhang <zhangbailin@inspur.com>

Closes-Bug: #1835063
Change-Id: I1c05d59ebf1fda6319df5ee305c2b8a6a9562242
2019-07-22 15:23:16 -04:00
Andreas Jaeger dbe6321537 Update api-ref location
The api documentation is now published on docs.openstack.org instead
of developer.openstack.org. Update all links that are changed to the
new location.

Note that Neutron publishes to api-ref/network, not networking anymore.

Note that redirects will be set up as well but let's point now to the
new location.

For details, see:
http://lists.openstack.org/pipermail/openstack-discuss/2019-July/007828.html

Change-Id: Id2cf3aa252df6db46575b5988e4937ecfc6792bb
2019-07-22 19:17:28 +02:00
zhu.boxiang 564290ab14 Add host and hypervisor_hostname flag to create server
Add a new microversion that adds two new params to create
server named 'host' and 'hypervisor_hostname'.

Part of Blueprint: add-host-and-hypervisor-hostname-flag-to-create-server

Change-Id: I3afea20edaf738da253ede44b4a07414ededafd6
2019-07-09 22:55:16 +08:00
Stephen Finucane 81e4d13c32 conf: Rename 'configuration drive' to 'config drive'
Keeps dansmith happy.

Change-Id: Ifd8537692de98ee02ff7333812d2877273a0a388
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2019-06-20 18:23:14 +01:00
Yikun Jiang 9614354535 Fix the server group "policy" field type in api-ref
The server group policy field added in v2.64 is a string but
the API reference says the parameter is an object.

This patch changes it from "object" to "string".

Change-Id: I1b4efe8afb302d94c810389e124c5370cbe72ddf
Closes-bug: #1830800
2019-05-29 09:16:51 +08:00
Zuul 780f737547 Merge "api-ref: 'os-hypervisors' doesn't reflect overcommit ratio" 2019-05-13 17:35:20 +00:00
Surya Seetharaman c541ace518 Microversion 2.73: Support adding the reason behind a server lock
This patch adds a new parameter ``locked_reason`` to
``POST /servers/{server_id}/action`` request where the
action is lock. It enables the user to specify a reason when locking
a server.

The locked_reason will be exposed through ``GET servers/{server_id}``,
``GET /servers/detail``, ``POST /servers/{server_id}/action``  where
the action is rebuild and ``PUT servers/{server_id}`` requests' responses.

The InstanceActionNotification will emit the locked_reason
along with the other instance details. This patch hence changes the
payload object to include the "locked_reason" field.

Note that "locked" will be allowed as a valid filtering/sorting parameter
for ``GET /servers/detail`` and ``GET /servers`` from this new microversion.

Implements blueprint add-locked-reason

Change-Id: I46edd595e7417c584106487123774a73c6dbe65e
2019-05-11 21:48:27 +00:00
Matt Riedemann 214656eff2 api-ref: fix description of os-server-external-events 'events' param
The description on the 'events' parameter for the
POST /os-server-external-events API did not make sense,
so this re-words it.

Change-Id: Iaec80e03a8ab0cd1b34126701bd0754953394e42
2019-04-03 18:08:41 -04:00
Matt Riedemann 3dbb0c4c57 api-ref: document ordering for instance actions and events
Whenever I use the os-instance-actions API I have to look at
the DB API source code to figure out the sort order of the
resulting instanceActions and each action's events, which
is desc(created_at) in both cases (and desc(id) but that should
not matter here since the id is not exposed in the API).

This change mentions the resulting sort order of those fields
in the API reference so I can stop looking at source code.

[1] https://github.com/openstack/nova/blob/e7ae6c65c/nova/db/sqlalchemy/api.py#L5149
[2] https://github.com/openstack/nova/blob/e7ae6c65c/nova/db/sqlalchemy/api.py#L5289

Change-Id: Ib5758bc21296e8b6c041198661c147b8e99d57e5
2019-04-03 18:03:28 -04:00
Matt Riedemann 45cecbb427 Fix JsonFilter query hint examples in docs
The API reference and part of the scheduler filter docs for
the JsonFilter query hint are using invalid json strings
in the examples.

This fixes both invalid locations using the same json string
used in the openstack server create command example in the
scheduler admin docs.

Change-Id: Iaab8608c7ffa6fbbea40a838dd02d8096f632f7a
Closes-Bug: #1821764
2019-03-26 12:05:30 -04:00
Takashi NATSUME f87bf4c6b9 api-ref: Add description for BDM volume_size
Add description of cases that 'block_device_mapping_v2.volume_size`
is required in the "Create Server" (POST /servers) API.

Change-Id: I36f28ca756b908b5fc591cc87f5786a3e217285e
Closes-Bug: #1818310
2019-03-13 16:17:20 +00:00
Zuul 482d8c9621 Merge "api-ref: explain aggregate set_metadata semantics" 2019-03-04 13:20:13 +00:00
Matt Riedemann 268190b252 api-ref: explain aggregate set_metadata semantics
This came up as a source of confusion while reviewing
change Ic27195e46502067c87ee9c71a811a3ca3f610b73 because
I thought that the "metadata" key in the
POST /os-aggregates/{aggregate_id}/action (set_metadata)
API was an overwrite of the existing metadata rather than
an update.

The way the Aggregate.update_metadata() method works is that
new entries are added, existing metadata is updated if the
value is not None, otherwise existing entries are removed
if the value is None.

And because of the AggregateAPI.is_safe_to_update_az() method
the special "availability_zone" metadata cannot be unset to None
once it is set. So the only way to remove an AZ is to delete the
aggregate altogether.

This updates the API reference description of the "metadata"
parameter in the "set_metadata" action API.

Change-Id: I6fa9f9691b945b5212b7f951ab0a26b4d3049df9
Related-Bug: #1378904
2019-03-01 12:36:42 -05:00
Matt Riedemann 1241e3ec2a Stop using "nova" in API samples when creating a server
The "availability_zone" parameter for server create in the
API reference and the availabilty zone user docs both say
that users should not use the default availability zone (nova)
yet our server create API samples use "nova" which is...bad.

This change fixes the API samples and related tests to use
a fake "us-west" availability zone. For any samples that were
requesting an AZ when creating a server, those are changed from
requesting "nova" to requesting "us-west" and a new
AvailabilityZoneFixture is added to stub out the code used to
validate the requested AZ and what is shown in server detail
responses.

Some unused samples are removed from the os-availability-zone
directory and the API reference and AZ user docs are updated for
formatting and linking to other docs for reference.

Change-Id: I3161157f15f05a3ffaaf1b48e7beb6b3e59c5513
Closes-Bug: #1817963
2019-03-01 10:43:08 -05:00
Yongli He 2cc7c0e589 Adds the server group info into show server detail API.
The server-groups UUID add to response of 'GET /servers/{id}',
'PUT /servers/{server_id}" and rebuild API
'POST /servers/{server_id}/action'.

Change-Id: I4a2a584df56ece7beb8b12c0ce9b0e6b30237120
Implements: blueprint show-server-group
Co-authored-by: Gerry Kopec <Gerry.Kopec@windriver.com>
Signed-off-by: Yongli He <yongli.he@intel.com>
2019-02-28 14:22:46 -05:00
Matt Riedemann 1c6fdc9aec Add microversion to expose virtual device tags
This change adds a new microversion to expose virtual
device tags for volumes and ports attached to a server.

Implements blueprint expose-virtual-device-tags-in-rest-api

Change-Id: I09420ff7134874dfe4dc399931c7740e81ecc2d0
2019-02-21 13:38:51 +00:00
Zuul f384b3b765 Merge "api-ref: warn about changing/unsetting AZ name with instances" 2019-02-19 19:19:52 +00:00
Stephen Finucane 36a91936a8 API: Remove evacuate/live-migrate 'force' parameter
Add a new microversion that removes support for the aforementioned
argument, which cannot be adequately guaranteed in the new placement
world.

Change-Id: I2a395aa6eccad75a97fa49e993b0300bdcfc7258
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Implements: blueprint remove-force-flag-from-live-migrate-and-evacuate
APIImpact
2019-02-08 17:05:19 -05:00
Matt Riedemann 5dc1ed3c5c api-ref: warn about changing/unsetting AZ name with instances
It is currently possible to rename or unset the availability_zone
metadata value on a host aggregate which can adversely impact
instances that were created in that specific AZ since later
attempts to migrate or unshelve those instances will fail if the
AZ with the original name no longer exists.

This adds a warning to the API reference for updating the AZ
name and also fixes a grammar typo in the 'metadata' response
parameter description.

Change-Id: Ie9d4a1ff1a23827490fe51350c11292c6efc4eb2
Related-Bug: #1378904
2019-02-06 16:11:40 -05:00
Zuul 88db2f9c0a Merge "Add restrictions on updated_at when getting instance action records" 2018-10-29 04:33:15 +00:00
Zuul 9a201632d3 Merge "Add restrictions on updated_at when getting migrations" 2018-10-27 00:42:54 +00:00
Zuul d223b1298b Merge "api-ref: Remove unnecessary minimum microversion" 2018-10-26 18:31:36 +00:00
Takashi NATSUME 4c531a5b94 api-ref: Add descriptions of error cases
In the following APIs, the 'changes-since' query parameter must be
earlier than or equal to 'changes-before' query parameter
otherwise the API returns 400.

* GET /servers
* GET /servers/detail

Add the description in each parameter.

Change-Id: Ieb26275deac2ddee3768a0fad7f37dc5795fb5c0
2018-10-25 07:46:30 +00:00