This patch introduce the REST API modifications to attach/detach a share
and list/show share mappings.
Manila is the OpenStack Shared Filesystems service.
These series of patches implement changes required in Nova to allow the shares
provided by Manila to be associated with and attached to instances using
virtiofs.
Implements: blueprint libvirt-virtiofs-attach-manila-shares
Change-Id: I0255a5697cd4ea148bd91c4f6fd183841d69a333
We move a check for unset microversions to after the check for a min or
max version filter. If we're not filtering, we don't need to fail.
Change-Id: Ic3b11b8233b3bb3e5016bce6653bb86908ef8874
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
We already tackled the action APIs for this resource. Now tackle the
remaining APIs.
Change-Id: I62de0e325d86f761a09c5a70e80d8d8209ed4bf1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This demonstrates far more complex response schemas, including the
response to the rebuild action which is effectively the response to the
server show API.
Change-Id: I6dc355f3c3f164d0bc7887a58e8b13979f0b476e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
When a user asks nova to attach a manila share to the user's instance
nova should use the user's keystone token to talk to manila so that
manila can verify if the user has access to the share.
Manila is the OpenStack Shared Filesystems service. These series
of patches implement changes required in Nova to allow the shares
provided by Manila to be associated with and attached to instances
using virtiofs.
Implements: blueprint libvirt-virtiofs-attach-manila-shares
Change-Id: I793f0518dcfffd2286e7bc685cab76794aece91d
At least those that don't return bodies (plus rescue, which is easy)
since they're tedious but simple, thus providing a good test ground for
this effort.
Change-Id: I78003b1d2c1515e5fd5e17405df6a219878bdb8a
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
The 'rxtx_factor' is a float, not an integer, and should allow values <
1 so long as they are > 0. Correct this.
Change-Id: I3567f13d7a1bb6f42755e3f5739fa9ecd827aa49
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
We already handled request bodies. Now we tackle query parameters. Note
that we're only handling GET requests currently since these are the APIs
where query parameters are most likely to be present. A future change
will add a test to verify that all methods handling GET requests have
schemas present.
This patch might look huge but every one of these schemas is effectively
a no-op since they're empty and have 'additionalProperties = True'. This
means there are lots of TODOs left in here which would be nice to tackle
in a future API microversion.
Change-Id: I80fc84df7c2be908856e6d4033b4922d7b0e9af1
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
There's no reason to inspect the API version requested (and reject
things if unset) if we don't have version constraints on the API
resource. This lets us add schema decorators to unversioned API
resources (i.e. the "versions" API at '/').
Change-Id: Ib4d4585e3e4664eba8cd3daa47b4349eb2bfed74
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
For APIs and resource actions that have been wholly removed and now
return a HTTP 4xx request regardless of microversion.
Change-Id: Ie3e90f4628dab4cc3e5983e0e8d8799dcf0465d8
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
OpenAPI 3.1 is a superset of JSON Schema Draft 2020-12. As a result, we
wish to migrate our current schemas to this. There are a couple of
issues to address:
- 'exclusiveMinimum' is now an integer and allows you to define an
minimum for an exclusive range, to complement 'minimum' which is used
for an inclusive range. We can drop it and use 'minimum' with a larger
number (since draft 6 [1]).
- 'integer' types can now accept a fractional part but only if it's zero
(i.e. '1.0' is permissible, '1.1' is not) (since draft 6 [1]).
- 'items' has been replaced with 'prefixItems' for describing the format
of an array item (since draft 2020-12 [2])
[1] https://json-schema.org/draft-06/json-schema-release-notes
[2] https://json-schema.org/draft/2020-12/release-notes
Change-Id: I1486701786960eef95c5c42674bff1b2d7d686e2
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
None of these should affect us at runtime but they are not technically
valid against JSON Schema Draft 4.
Change-Id: Iaae8998a34ff812b9f76a0cd1fa9be4555c89b98
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This provides us a path to generate OpenAPI schemas for the nova API.
Thankfully most of the API documentation is pretty darn simple. Note
that we need to fix a lot of unit tests so that they pass correct bodies
to the controller methods under test. Also note that the
'reset_server_state' module in 'nova.api.openstack.compute.schemas' is
renamed to 'admin_actions' to match the name of the module containing
the controller itself, as is the case for all other schemas.
Change-Id: I39098fb621b120589ed6a923ce64207ee26e91aa
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
These are deprecated but there's value in having a proper - if loose -
schema in place for API documentation purposes. Also, doing things this
way allows us to remove a whole load of hand-rolled stuff.
Change-Id: I4106cfa2a09d135f12892ed6d1f42f4151dc72e4
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
When user tries to add stateless and stateful security
groups on same port, neutron raises SecurityGroupConflict (409),
but nova doesnot handle it and raises InternalServerError (500).
As it appears to be invalid operation from user, so user should get
the message that they are doing wrong.
This changes catches SecurityGroupConflict from neutron
client and raises newly added nova exception
SecurityGroupConnectionStateConflict with 409 error code.
Closes-Bug: #2056195
Change-Id: Ifad28fdd536ff0a4b30e786b2fcbc5a55987a13a
After this patch nova rejects the add host to aggregate API action
if the host has instances and the new aggregate for the host would
mean that these instances need to move from one AZ (even from the
default one) to another. Such AZ change is not implemented in nova
and currently leads to stuck instances.
Similarly nova will reject remove host from aggregate API action if the
host has instances and the aggregate removal would mean that the
instances need to change AZ.
Depends-On: https://review.opendev.org/c/openstack/tempest/+/821732
Change-Id: I19c4c6d34aa2cc1f32d81e8c1a52762fa3a18580
Closes-Bug: #1907775
We need to be able to resolve the original, unversioned methods.
Register these things slightly differently. It would likely be better to
fold these action controllers into the main controllers, but that's a
lot of code motion that I don't really want to do right now.
Change-Id: Iee37500e6b2dbacf0c1514bfc52ef2dfe8ceb94f
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This is an odd child, registering standard REST operations as actions
(in the '/action' API sense of the term). There's no reason for this
delineation these days so simply remove it. This makes auto-generation
much easier down the road.
Change-Id: Ia45013fc988acb9517aea42c3caa1fa45d63892e
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
This has many of the attributes of the 'Controller' class but does not
subclass it. This means we are missing attributes like 'wsgi_actions'
as well as helper methods like 'version_select', 'api_version',
'is_valid_body', and 'check_for_versions_intersection'. We correctly
subclass for every other controller and there's no reason for us not to
do so here, so correct this oversight.
Change-Id: Ib89e2e02e8c85cc27f5b55caca5711e773959288
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
As of now, the server show and server list --long output
shows the availability zone, that is, the AZ to which the
host of the instance belongs. There is no way to tell from
this information if the instance create request included an
AZ or not.
This change adds a new api microversion to add support for
including availability zone requested during instance create
in server show and server list --long responses.
Change-Id: If4cf09c1006a3f56d243b9c00712bb24d2a796d3
RDP console was only for HyperV driver so removing the
API. As API url stay same (because same used for other
console types API), RDP console API will return 400.
Cleaning up the related config options as well as moving its
API ref to obsolete seciton.
Keeping RPC method to avoid error when old controller is used
with new compute. It can be removed in next RPC version bump.
Change-Id: I8f5755009da4af0d12bda096d7a8e85fd41e1a8c
The RDP console was only available for HyperV driver, therefore its
connection information via API ``os-console-auth-tokens`` will now return
HTTP ``400 (BadRequest)`` error.
Starting from 2.31 microversion, this API return connection info
for all other console type.
Change-Id: I94e590eb4cbe3b2d8eff7fe881f7b98af8979be2
This chnage adds the pre-commit config and
tox targets to run codespell both indepenetly
and via the pep8 target.
This change correct all the final typos in the
codebase as detected by codespell.
Change-Id: Ic4fb5b3a5559bc3c43aca0a39edc0885da58eaa2
This option was deprecated in favor of the HTTPProxyToWSGI middleware
in 26.0.0 release[1].
[1] cf906cdcc2
Related-Bug: #1967686
Change-Id: Iad8880127531dc2788d646f8a05b5c17fd9d0969
We want this module for use elsewhere. Given there's only a single
caller (nova.service) we can simply move the code to the caller.
Change-Id: I2c3887db8b3f6833bf24f5114fd955e1af590d03
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
We had indicated that we would never switch this over to SDK, however,
this is the sole remaining user of ironicclient which means users would
continue needing to install that just for this little API. Better to
switch this holdout over and finally delete all the things.
Change-Id: I880523935d73ca94c83e618f10c2e587362c53be
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
this is the inital patch of applying codespell to nova.
codespell is a programing focused spellchecker that
looks for common typos and corrects them.
i am breaking this into multiple commits to make it simpler
to read and will automate the execution of codespell
at the end of the series.
Change-Id: If24a6c0a890f713545faa2d44b069c352655274e