Merge "proxy: Add api_version attribute"
This commit is contained in:
@@ -22,6 +22,8 @@ from openstack import resource
|
||||
|
||||
|
||||
class Proxy(proxy.Proxy):
|
||||
api_version = '2'
|
||||
|
||||
# ========== Deployables ==========
|
||||
|
||||
def deployables(self, **query):
|
||||
|
||||
@@ -34,6 +34,8 @@ from openstack import utils
|
||||
|
||||
|
||||
class Proxy(proxy.Proxy):
|
||||
api_version = '1'
|
||||
|
||||
retriable_status_codes = _common.RETRIABLE_STATUS_CODES
|
||||
|
||||
_resource_registry = {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -34,6 +34,8 @@ from openstack import warnings as os_warnings
|
||||
|
||||
|
||||
class Proxy(proxy.Proxy):
|
||||
api_version = '2'
|
||||
|
||||
# ========== Extensions ==========
|
||||
|
||||
def extensions(self):
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -21,6 +21,8 @@ from openstack import resource
|
||||
|
||||
|
||||
class Proxy(proxy.Proxy):
|
||||
api_version = '1'
|
||||
|
||||
_resource_registry = {
|
||||
"database": _database.Database,
|
||||
"flavor": _flavor.Flavor,
|
||||
|
||||
@@ -31,6 +31,8 @@ from openstack import resource
|
||||
|
||||
|
||||
class Proxy(proxy.Proxy):
|
||||
api_version = '2'
|
||||
|
||||
_resource_registry = {
|
||||
"blacklist": _blacklist.Blacklist,
|
||||
"floating_ip": _fip.FloatingIP,
|
||||
|
||||
@@ -21,6 +21,8 @@ from openstack import resource
|
||||
|
||||
|
||||
class Proxy(proxy.Proxy):
|
||||
api_version = '2'
|
||||
|
||||
def extensions(self):
|
||||
"""Retrieve a generator of extensions
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -22,6 +22,8 @@ from openstack import resource
|
||||
|
||||
|
||||
class Proxy(proxy.Proxy):
|
||||
api_version = '1'
|
||||
|
||||
_resource_registry = {
|
||||
"container": _container.Container,
|
||||
"order": _order.Order,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -21,6 +21,8 @@ from openstack import resource
|
||||
|
||||
|
||||
class Proxy(proxy.Proxy):
|
||||
api_version = '2'
|
||||
|
||||
_resource_registry = {
|
||||
"claim": _claim.Claim,
|
||||
"message": _message.Message,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -43,6 +43,8 @@ def _get_expiration(expiration):
|
||||
|
||||
|
||||
class Proxy(proxy.Proxy):
|
||||
api_version = '1'
|
||||
|
||||
_resource_registry = {
|
||||
"account": _account.Account,
|
||||
"container": _container.Container,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user