![Akihiro Motoki](/assets/img/avatar_default.png)
This commit updates links affected by doc migration. Note that other links are not touched in this commit. Fixing other broken links or changing http to https should be covered by a separate patch. Also convert http links to docs.openstack.org to https per reviewer request (though it is not directly related to doc-migration). Note that this commit does not touch files under releasenotes/notes/. If we touch release notes in older releases, reno will considers it as a release note in the current release. (Pike release notes are clean up in a separate patch.) Change-Id: Iba9bd465ef08014a4972584cf4da6e7d77961119
1.7 KiB
Horizon Microversion Support
Introduction
Several services use API microversions, which allows consumers of that API to specify an exact version when making a request. This can be useful in ensuring a feature continues to work as expected across many service releases.
Adding a feature that was introduced in a microversion
Add the feature to the
MICROVERSION_FEATURES
dict inopenstack_dashboard/api/microversions.py
under the appropriate service name. The feature should have at least two versions listed; the minimum version (i.e. the version that introduced the feature) and the current working version. Providing multiple versions reduces project maintenance overheads and helps Horizon work with older service deployments.Use the
is_feature_available
function for your service to show or hide the function.:from openstack_dashboard.api import service ... def allowed(self, request): return service.is_feature_available('feature')
Send the correct microversion with
get_microversion
function in the API layer.:def resource_list(request): try: microversion = get_microversion(request, 'feature') client = serviceclient(request, microversion) return client.resource_list()