The nova.api.openstack.api_version_request Module

class APIVersionRequest(version_string=None)

Bases: object

This class represents an API Version Request with convenience methods for manipulation and comparison of version numbers that we need to do to implement microversions.

get_string()

Converts object to string representation which if used to create an APIVersionRequest object results in the same version request.

is_null()
matches(min_version, max_version)

Returns whether the version object represents a version greater than or equal to the minimum version and less than or equal to the maximum version.

@param min_version: Minimum acceptable version. @param max_version: Maximum acceptable version. @returns: boolean

If min_version is null then there is no minimum limit. If max_version is null then there is no maximum limit. If self is null then raise ValueError

is_supported(req, min_version='2.1', max_version='2.25')

Check if API request version satisfies version restrictions.

Parameters:
  • req – request object
  • min_version – minimal version of API needed for correct request processing
  • max_version – maximum version of API needed for correct request processing
:returns True if request satisfies minimal and maximum API version
requirements. False in other case.
max_api_version()
min_api_version()

Previous topic

The nova.api.metadata.vendordata_json Module

Next topic

The nova.api.openstack.auth Module

Project Source

This Page