Merge "proxy: Add api_version attribute"

This commit is contained in:
Zuul
2026-03-07 15:30:07 +00:00
committed by Gerrit Code Review
25 changed files with 53 additions and 4 deletions

View File

@@ -22,6 +22,8 @@ from openstack import resource
class Proxy(proxy.Proxy):
api_version = '2'
# ========== Deployables ==========
def deployables(self, **query):

View File

@@ -34,6 +34,8 @@ from openstack import utils
class Proxy(proxy.Proxy):
api_version = '1'
retriable_status_codes = _common.RETRIABLE_STATUS_CODES
_resource_registry = {

View File

@@ -27,6 +27,8 @@ _logger = _log.setup_logging('openstack')
class Proxy(proxy.Proxy):
api_version = '1'
_resource_registry = {
"introspection": _introspect.Introspection,
"introspection_rule": _introspection_rule.IntrospectionRule,

View File

@@ -34,6 +34,8 @@ from openstack import warnings as os_warnings
class Proxy(proxy.Proxy):
api_version = '2'
# ========== Extensions ==========
def extensions(self):

View File

@@ -42,6 +42,8 @@ from openstack import warnings as os_warnings
class Proxy(proxy.Proxy):
api_version = '3'
_resource_registry = {
"availability_zone": availability_zone.AvailabilityZone,
"attachment": _attachment.Attachment,

View File

@@ -30,6 +30,8 @@ from openstack import resource
class Proxy(proxy.Proxy):
api_version = '1'
_resource_registry = {
"action": _action.Action,
"build_info": build_info.BuildInfo,

View File

@@ -49,6 +49,8 @@ from openstack import warnings as os_warnings
class Proxy(proxy.Proxy):
api_version = '2'
_resource_registry = {
"aggregate": _aggregate.Aggregate,
"availability_zone": availability_zone.AvailabilityZone,

View File

@@ -29,6 +29,8 @@ from openstack import resource
class Proxy(proxy.Proxy):
api_version = '1'
_resource_registry = {
"cluster": _cluster.Cluster,
"cluster_template": _cluster_template.ClusterTemplate,

View File

@@ -21,6 +21,8 @@ from openstack import resource
class Proxy(proxy.Proxy):
api_version = '1'
_resource_registry = {
"database": _database.Database,
"flavor": _flavor.Flavor,

View File

@@ -31,6 +31,8 @@ from openstack import resource
class Proxy(proxy.Proxy):
api_version = '2'
_resource_registry = {
"blacklist": _blacklist.Blacklist,
"floating_ip": _fip.FloatingIP,

View File

@@ -21,6 +21,8 @@ from openstack import resource
class Proxy(proxy.Proxy):
api_version = '2'
def extensions(self):
"""Retrieve a generator of extensions

View File

@@ -64,6 +64,8 @@ from openstack import warnings as os_warnings
class Proxy(proxy.Proxy):
api_version = '3'
_resource_registry = {
"application_credential": _application_credential.ApplicationCredential, # noqa: E501
"access_rule": _access_rule.AccessRule,

View File

@@ -37,6 +37,8 @@ def _get_name_and_filename(name, image_format):
class Proxy(proxy.Proxy):
api_version = '1'
retriable_status_codes = [503]
_IMAGE_MD5_KEY = 'owner_specified.openstack.md5'

View File

@@ -54,6 +54,8 @@ def _get_name_and_filename(name, image_format):
class Proxy(proxy.Proxy):
api_version = '2'
_resource_registry = {
"cache": _cache.Cache,
"image": _image.Image,

View File

@@ -24,10 +24,7 @@ from openstack import resource
class Proxy(proxy.Proxy):
"""Proxy class for ha resource handling.
Create method for each action of each API.
"""
api_version = '1'
_resource_registry = {
"host": _host.Host,

View File

@@ -22,6 +22,8 @@ from openstack import resource
class Proxy(proxy.Proxy):
api_version = '1'
_resource_registry = {
"container": _container.Container,
"order": _order.Order,

View File

@@ -33,6 +33,8 @@ from openstack import resource
class Proxy(proxy.Proxy):
api_version = '2'
_resource_registry = {
"amphora": _amphora.Amphora,
"availability_zone": _availability_zone.AvailabilityZone,

View File

@@ -21,6 +21,8 @@ from openstack import resource
class Proxy(proxy.Proxy):
api_version = '2'
_resource_registry = {
"claim": _claim.Claim,
"message": _message.Message,

View File

@@ -109,6 +109,8 @@ from openstack import resource
class Proxy(proxy.Proxy):
api_version = '2'
_resource_registry = {
"address_group": _address_group.AddressGroup,
"address_scope": _address_scope.AddressScope,

View File

@@ -43,6 +43,8 @@ def _get_expiration(expiration):
class Proxy(proxy.Proxy):
api_version = '1'
_resource_registry = {
"account": _account.Account,
"container": _container.Container,

View File

@@ -30,6 +30,8 @@ from openstack import resource
# TODO(rladntjr4): Some of these methods support lookup by ID, while others
# support lookup by ID or name. We should choose one and use it consistently.
class Proxy(proxy.Proxy):
api_version = '1'
_resource_registry = {
"resource": _resource.Resource,
"software_config": _sc.SoftwareConfig,

View File

@@ -23,6 +23,8 @@ from openstack import resource
class Proxy(proxy.Proxy):
api_version = '1'
_resource_registry = {
"resource_class": _resource_class.ResourceClass,
"resource_provider": _resource_provider.ResourceProvider,

View File

@@ -64,6 +64,12 @@ class CleanupDependency(ty.TypedDict):
class Proxy(adapter.Adapter):
"""Represents a service."""
api_version: ty.ClassVar[str]
"""The API version.
This is used as a descriminating attribute for type checking.
"""
retriable_status_codes: list[int] | None = None
"""HTTP status codes that should be retried by default.

View File

@@ -46,6 +46,8 @@ from openstack.shared_file_system.v2 import user_message as _user_message
class Proxy(proxy.Proxy):
api_version = '2'
_resource_registry = {
"availability_zone": _availability_zone.AvailabilityZone,
"share_snapshot": _share_snapshot.ShareSnapshot,

View File

@@ -20,6 +20,8 @@ from openstack.workflow.v2 import workflow as _workflow
class Proxy(proxy.Proxy):
api_version = '2'
_resource_registry = {
"execution": _execution.Execution,
"workflow": _workflow.Workflow,