cinder.api.microversions module¶
API Microversion definitions.
All new microversions should have a constant added here to be used throughout the code instead of the specific version number. Until patches land, it’s common to end up with merge conflicts with other microversion changes. Merge conflicts will be easier to handle via the microversion constants defined here as the version number will only need to be changed in a single location.
Actual version numbers should be used:
In this file
In cinder/api/openstack/rest_api_version_history.rst
In cinder/api/openstack/api_version_request.py
In release notes describing the new functionality
In updates to api-ref
Nearly all microversion changes should include changes to all of those locations. Make sure to add relevant documentation, and make sure that documentation includes the final version number used.
- get_api_version(version)¶
Gets a
APIVersionRequest
instance.- Parameters:
version – The microversion needed.
- Returns:
The
APIVersionRequest
instance.
- get_mv_header(version)¶
Gets a formatted HTTP microversion header.
- Parameters:
version – The microversion needed.
- Returns:
A tuple containing the microversion header with the requested version value.
- get_prior_version(version)¶
Gets the microversion before the given version.
Mostly useful for testing boundaries. This gets the microversion defined just prior to the given version.
- Parameters:
version – The version of interest.
- Returns:
The version just prior to the given version.