diff --git a/openstack/accelerator/v2/_proxy.py b/openstack/accelerator/v2/_proxy.py index 01c6bb23d..37b69d338 100644 --- a/openstack/accelerator/v2/_proxy.py +++ b/openstack/accelerator/v2/_proxy.py @@ -22,6 +22,8 @@ from openstack import resource class Proxy(proxy.Proxy): + api_version = '2' + # ========== Deployables ========== def deployables(self, **query): diff --git a/openstack/baremetal/v1/_proxy.py b/openstack/baremetal/v1/_proxy.py index c519f913e..be3bfe29b 100644 --- a/openstack/baremetal/v1/_proxy.py +++ b/openstack/baremetal/v1/_proxy.py @@ -34,6 +34,8 @@ from openstack import utils class Proxy(proxy.Proxy): + api_version = '1' + retriable_status_codes = _common.RETRIABLE_STATUS_CODES _resource_registry = { diff --git a/openstack/baremetal_introspection/v1/_proxy.py b/openstack/baremetal_introspection/v1/_proxy.py index dad69372c..0991f4dea 100644 --- a/openstack/baremetal_introspection/v1/_proxy.py +++ b/openstack/baremetal_introspection/v1/_proxy.py @@ -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, diff --git a/openstack/block_storage/v2/_proxy.py b/openstack/block_storage/v2/_proxy.py index adb149d04..febb9c35a 100644 --- a/openstack/block_storage/v2/_proxy.py +++ b/openstack/block_storage/v2/_proxy.py @@ -34,6 +34,8 @@ from openstack import warnings as os_warnings class Proxy(proxy.Proxy): + api_version = '2' + # ========== Extensions ========== def extensions(self): diff --git a/openstack/block_storage/v3/_proxy.py b/openstack/block_storage/v3/_proxy.py index 2c76de7aa..e3b2d0983 100644 --- a/openstack/block_storage/v3/_proxy.py +++ b/openstack/block_storage/v3/_proxy.py @@ -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, diff --git a/openstack/clustering/v1/_proxy.py b/openstack/clustering/v1/_proxy.py index 73c644211..c63bbb39f 100644 --- a/openstack/clustering/v1/_proxy.py +++ b/openstack/clustering/v1/_proxy.py @@ -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, diff --git a/openstack/compute/v2/_proxy.py b/openstack/compute/v2/_proxy.py index c7505bd6f..66b5cc99a 100644 --- a/openstack/compute/v2/_proxy.py +++ b/openstack/compute/v2/_proxy.py @@ -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, diff --git a/openstack/container_infrastructure_management/v1/_proxy.py b/openstack/container_infrastructure_management/v1/_proxy.py index 09e2d864a..6aeab8969 100644 --- a/openstack/container_infrastructure_management/v1/_proxy.py +++ b/openstack/container_infrastructure_management/v1/_proxy.py @@ -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, diff --git a/openstack/database/v1/_proxy.py b/openstack/database/v1/_proxy.py index 5e3cba2b8..bf5ba9e34 100644 --- a/openstack/database/v1/_proxy.py +++ b/openstack/database/v1/_proxy.py @@ -21,6 +21,8 @@ from openstack import resource class Proxy(proxy.Proxy): + api_version = '1' + _resource_registry = { "database": _database.Database, "flavor": _flavor.Flavor, diff --git a/openstack/dns/v2/_proxy.py b/openstack/dns/v2/_proxy.py index 6ebecb37a..db5cff873 100644 --- a/openstack/dns/v2/_proxy.py +++ b/openstack/dns/v2/_proxy.py @@ -31,6 +31,8 @@ from openstack import resource class Proxy(proxy.Proxy): + api_version = '2' + _resource_registry = { "blacklist": _blacklist.Blacklist, "floating_ip": _fip.FloatingIP, diff --git a/openstack/identity/v2/_proxy.py b/openstack/identity/v2/_proxy.py index e61143821..778ad9002 100644 --- a/openstack/identity/v2/_proxy.py +++ b/openstack/identity/v2/_proxy.py @@ -21,6 +21,8 @@ from openstack import resource class Proxy(proxy.Proxy): + api_version = '2' + def extensions(self): """Retrieve a generator of extensions diff --git a/openstack/identity/v3/_proxy.py b/openstack/identity/v3/_proxy.py index eeebf0f7e..fbcb0ff27 100644 --- a/openstack/identity/v3/_proxy.py +++ b/openstack/identity/v3/_proxy.py @@ -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, diff --git a/openstack/image/v1/_proxy.py b/openstack/image/v1/_proxy.py index 9736ab289..5bdb90d85 100644 --- a/openstack/image/v1/_proxy.py +++ b/openstack/image/v1/_proxy.py @@ -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' diff --git a/openstack/image/v2/_proxy.py b/openstack/image/v2/_proxy.py index a1fc183e7..77c7bd69a 100644 --- a/openstack/image/v2/_proxy.py +++ b/openstack/image/v2/_proxy.py @@ -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, diff --git a/openstack/instance_ha/v1/_proxy.py b/openstack/instance_ha/v1/_proxy.py index de3f37af8..88c6f760d 100644 --- a/openstack/instance_ha/v1/_proxy.py +++ b/openstack/instance_ha/v1/_proxy.py @@ -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, diff --git a/openstack/key_manager/v1/_proxy.py b/openstack/key_manager/v1/_proxy.py index fe668633f..0c5924712 100644 --- a/openstack/key_manager/v1/_proxy.py +++ b/openstack/key_manager/v1/_proxy.py @@ -22,6 +22,8 @@ from openstack import resource class Proxy(proxy.Proxy): + api_version = '1' + _resource_registry = { "container": _container.Container, "order": _order.Order, diff --git a/openstack/load_balancer/v2/_proxy.py b/openstack/load_balancer/v2/_proxy.py index 1e34765ce..69769e111 100644 --- a/openstack/load_balancer/v2/_proxy.py +++ b/openstack/load_balancer/v2/_proxy.py @@ -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, diff --git a/openstack/message/v2/_proxy.py b/openstack/message/v2/_proxy.py index db5c11f28..0c3a32d55 100644 --- a/openstack/message/v2/_proxy.py +++ b/openstack/message/v2/_proxy.py @@ -21,6 +21,8 @@ from openstack import resource class Proxy(proxy.Proxy): + api_version = '2' + _resource_registry = { "claim": _claim.Claim, "message": _message.Message, diff --git a/openstack/network/v2/_proxy.py b/openstack/network/v2/_proxy.py index 9177ee798..bbd5ab408 100644 --- a/openstack/network/v2/_proxy.py +++ b/openstack/network/v2/_proxy.py @@ -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, diff --git a/openstack/object_store/v1/_proxy.py b/openstack/object_store/v1/_proxy.py index fb93aa744..1995d085a 100644 --- a/openstack/object_store/v1/_proxy.py +++ b/openstack/object_store/v1/_proxy.py @@ -43,6 +43,8 @@ def _get_expiration(expiration): class Proxy(proxy.Proxy): + api_version = '1' + _resource_registry = { "account": _account.Account, "container": _container.Container, diff --git a/openstack/orchestration/v1/_proxy.py b/openstack/orchestration/v1/_proxy.py index cc2749731..541678398 100644 --- a/openstack/orchestration/v1/_proxy.py +++ b/openstack/orchestration/v1/_proxy.py @@ -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, diff --git a/openstack/placement/v1/_proxy.py b/openstack/placement/v1/_proxy.py index b3496c897..56cc733c4 100644 --- a/openstack/placement/v1/_proxy.py +++ b/openstack/placement/v1/_proxy.py @@ -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, diff --git a/openstack/proxy.py b/openstack/proxy.py index 63227316f..ca04e2ed6 100644 --- a/openstack/proxy.py +++ b/openstack/proxy.py @@ -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. diff --git a/openstack/shared_file_system/v2/_proxy.py b/openstack/shared_file_system/v2/_proxy.py index 2c74894f2..c38cd41d7 100644 --- a/openstack/shared_file_system/v2/_proxy.py +++ b/openstack/shared_file_system/v2/_proxy.py @@ -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, diff --git a/openstack/workflow/v2/_proxy.py b/openstack/workflow/v2/_proxy.py index 8fa7bb336..bae87831d 100644 --- a/openstack/workflow/v2/_proxy.py +++ b/openstack/workflow/v2/_proxy.py @@ -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,