83030804cc
In relevant requests to the placement API add last-modified and cache-control headers. According the HTTP 1.1 RFC headers last-modified headers SHOULD always be sent and should have a tie to the real last modified time. If we do send them, we need Cache-Control headers to prevent inadvertent caching of resources. This change adds a microversion 1.15 which adds the headers to GET requests and some PUT or POST requests. Despite what it says 'no-cache' means "check to see if the version you have is still valid as far as the server is concerned". Since our server doesn't currently validate conditional requests and will always return an entity, it ends up meaning "don't cache" (which is what we want). The main steps in the patch are: * To both the get single entity and get collection handlers add response.cache_control = 'no-cache' * For single entity add response.last_modified = obj.updated_at or obj.created_at * For collections, discover the max modified time when traversing the list of objects to create the serialized JSON output. In most of those loops an optimization is done where we only check for last-modified information if we have a high enough microversion such that the information will be used. This is not done when listing inventories because the expectation is that no single resource provider will ever have a huge number of inventory records. * Both of the prior steps are assisted by a new util method: pick_last_modfied. Where a time cannot be determined the current time is used. In typical placement framework fashion this has been done in a very explicit way, as it makes what the handler is doing very visible, even though it results in a bit of boilerplate. For those requests that are created from multiple objects or by doing calculations, such as usages and aggregate associations, the current time is used. The handler for PUT /traits is modified a bit more extensively than some of the others: This is because the method can either create or validate the existence of the trait. In the case where the trait already exists, we need to get it from the DB to get its created_at time. We only do this if the microversion is high enough (at least 1.15) to warrant needing the info. Because these changes add new headers (even though they don't do anything) a new microversion, 1.15, is added. Partial-Bug: #1632852 Partially-Implements: bp placement-cache-headers Change-Id: I727d4c77aaa31f0ef31c8af22c2d46cad8ab8b8e |
||
---|---|---|
api-guide/source | ||
api-ref/source | ||
contrib | ||
devstack | ||
doc | ||
etc/nova | ||
gate | ||
nova | ||
placement-api-ref/source | ||
releasenotes | ||
tools | ||
.coveragerc | ||
.gitignore | ||
.gitreview | ||
.mailmap | ||
.stestr.conf | ||
.testr.conf | ||
babel.cfg | ||
bindep.txt | ||
CONTRIBUTING.rst | ||
HACKING.rst | ||
LICENSE | ||
MAINTAINERS | ||
README.rst | ||
requirements.txt | ||
setup.cfg | ||
setup.py | ||
test-requirements.txt | ||
tests-functional-py3.txt | ||
tests-py3.txt | ||
tox.ini |
Team and repository tags
OpenStack Nova
OpenStack Nova provides a cloud computing fabric controller, supporting a wide variety of compute technologies, including: libvirt (KVM, Xen, LXC and more), Hyper-V, VMware, XenServer, OpenStack Ironic and PowerVM.
Use the following resources to learn more.
API
To learn how to use Nova's API, consult the documentation available online at:
For more information on OpenStack APIs, SDKs and CLIs in general, refer to:
Operators
To learn how to deploy and configure OpenStack Nova, consult the documentation available online at:
In the unfortunate event that bugs are discovered, they should be reported to the appropriate bug tracker. If you obtained the software from a 3rd party operating system vendor, it is often wise to use their own bug tracker for reporting problems. In all other cases use the master OpenStack bug tracker, available at:
Developers
For information on how to contribute to Nova, please see the contents of the CONTRIBUTING.rst.
Any new code must follow the development guidelines detailed in the HACKING.rst file, and pass all unit tests.
Further developer focused documentation is available at:
Other Information
During each Summit and Project Team Gathering, we agree on what the whole community wants to focus on for the upcoming release. The plans for nova can be found at: