diff options
author | Jenkins <jenkins@review.openstack.org> | 2016-01-25 02:36:46 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2016-01-25 02:36:48 +0000 |
commit | 2b1d5a9b369d031e87fdab1c28806c0e6c88bf1d (patch) | |
tree | a899ea15b5c96605db4b6d2c1cecbdc2981f95ad /api-guide | |
parent | aa9db1ccef646c07f4946676feeac762ced8997a (diff) | |
parent | d87f6b4537f37fb0e75d893927a7261ee77565d6 (diff) | |
download | nova-2b1d5a9b369d031e87fdab1c28806c0e6c88bf1d.tar.gz |
Merge "doc: add client interactive guideline for microversions"
Diffstat (limited to 'api-guide')
-rw-r--r-- | api-guide/source/microversions.rst | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/api-guide/source/microversions.rst b/api-guide/source/microversions.rst index ee8d494480..a8c138c772 100644 --- a/api-guide/source/microversions.rst +++ b/api-guide/source/microversions.rst @@ -98,3 +98,45 @@ microversion to access the endpoint. You can also obtain specific endpoint version information by performing a GET on the base version URL (e.g., `http://openstack.example.com/v2.1/`). You can get more information about the version API at :doc:`versions`. + +Client Interaction +================== + +A client specifies the microversion of the API they want by using the following +HTTP header:: + + X-OpenStack-Nova-API-Version: 2.4 + +This acts conceptually like the "Accept" header. Semantically this means: + +* If `X-OpenStack-Nova-API-Version` is not provided, act as if the minimum + supported microversion was specified. + +* If `X-OpenStack-Nova-API-Version` is provided, respond with the API at + that microversion. If that's outside of the range of microversions supported, + return 406 Not Acceptable. + +* If `X-OpenStack-Nova-API-Version` is ``latest`` (special keyword), act as + if maximum was specified. + +.. warning:: The ``latest`` value is mostly meant for integration testing and + would be dangerous to rely on in client code since microversions are not + following semver and therefore backward compability is not guaranteed. + Clients should always require a specific microversion but limit what is + acceptable to the microversion range that it understands at the time. + +This means that out of the box, an old client without any knowledge of +microversions can work with an Openstack installation with microversions +support. + +Two extra headers are always returned in the response: + +* X-OpenStack-Nova-API-Version: microversion_number +* Vary: X-OpenStack-Nova-API-Version + +The first header specifies the microversion number of the API which was +executed. + +The second header is used as a hint to caching proxies that the response +is also dependent on the X-OpenStack-Nova-API-Version and not just +the body and query parameters. See :rfc:`2616` section 14.44 for details. |