From 80b3f57a1f8178733f2b3f2e224228772d33b634 Mon Sep 17 00:00:00 2001 From: Scaleway Bot Date: Fri, 19 Apr 2024 16:53:31 +0200 Subject: [PATCH] feat(rdb): add of private network details (#496) --- scaleway-async/scaleway_async/rdb/v1/__init__.py | 2 ++ scaleway-async/scaleway_async/rdb/v1/marshalling.py | 4 ++++ scaleway-async/scaleway_async/rdb/v1/types.py | 13 +++++++++++++ scaleway/scaleway/rdb/v1/__init__.py | 2 ++ scaleway/scaleway/rdb/v1/marshalling.py | 4 ++++ scaleway/scaleway/rdb/v1/types.py | 13 +++++++++++++ 6 files changed, 38 insertions(+) diff --git a/scaleway-async/scaleway_async/rdb/v1/__init__.py b/scaleway-async/scaleway_async/rdb/v1/__init__.py index f2affddf..2d37d9c6 100644 --- a/scaleway-async/scaleway_async/rdb/v1/__init__.py +++ b/scaleway-async/scaleway_async/rdb/v1/__init__.py @@ -5,6 +5,7 @@ from .types import ACLRuleProtocol from .types import DatabaseBackupStatus from .content import DATABASE_BACKUP_TRANSIENT_STATUSES +from .types import EndpointPrivateNetworkDetailsProvisioningMode from .types import EngineSettingPropertyType from .types import InstanceLogStatus from .content import INSTANCE_LOG_TRANSIENT_STATUSES @@ -150,6 +151,7 @@ "ACLRuleProtocol", "DatabaseBackupStatus", "DATABASE_BACKUP_TRANSIENT_STATUSES", + "EndpointPrivateNetworkDetailsProvisioningMode", "EngineSettingPropertyType", "InstanceLogStatus", "INSTANCE_LOG_TRANSIENT_STATUSES", diff --git a/scaleway-async/scaleway_async/rdb/v1/marshalling.py b/scaleway-async/scaleway_async/rdb/v1/marshalling.py index a480738f..4d244064 100644 --- a/scaleway-async/scaleway_async/rdb/v1/marshalling.py +++ b/scaleway-async/scaleway_async/rdb/v1/marshalling.py @@ -140,6 +140,10 @@ def unmarshal_EndpointPrivateNetworkDetails(data: Any) -> EndpointPrivateNetwork if field is not None: args["zone"] = field + field = data.get("provisioning_mode", None) + if field is not None: + args["provisioning_mode"] = field + return EndpointPrivateNetworkDetails(**args) diff --git a/scaleway-async/scaleway_async/rdb/v1/types.py b/scaleway-async/scaleway_async/rdb/v1/types.py index ef41a5e2..21fe9974 100644 --- a/scaleway-async/scaleway_async/rdb/v1/types.py +++ b/scaleway-async/scaleway_async/rdb/v1/types.py @@ -56,6 +56,14 @@ def __str__(self) -> str: return str(self.value) +class EndpointPrivateNetworkDetailsProvisioningMode(str, Enum, metaclass=StrEnumMeta): + STATIC = "static" + IPAM = "ipam" + + def __str__(self) -> str: + return str(self.value) + + class EngineSettingPropertyType(str, Enum, metaclass=StrEnumMeta): BOOLEAN = "boolean" INT = "int" @@ -286,6 +294,11 @@ class EndpointPrivateNetworkDetails: Private network zone. """ + provisioning_mode: EndpointPrivateNetworkDetailsProvisioningMode + """ + How endpoint ips are provisioned. + """ + @dataclass class EndpointSpecPrivateNetworkIpamConfig: diff --git a/scaleway/scaleway/rdb/v1/__init__.py b/scaleway/scaleway/rdb/v1/__init__.py index f2affddf..2d37d9c6 100644 --- a/scaleway/scaleway/rdb/v1/__init__.py +++ b/scaleway/scaleway/rdb/v1/__init__.py @@ -5,6 +5,7 @@ from .types import ACLRuleProtocol from .types import DatabaseBackupStatus from .content import DATABASE_BACKUP_TRANSIENT_STATUSES +from .types import EndpointPrivateNetworkDetailsProvisioningMode from .types import EngineSettingPropertyType from .types import InstanceLogStatus from .content import INSTANCE_LOG_TRANSIENT_STATUSES @@ -150,6 +151,7 @@ "ACLRuleProtocol", "DatabaseBackupStatus", "DATABASE_BACKUP_TRANSIENT_STATUSES", + "EndpointPrivateNetworkDetailsProvisioningMode", "EngineSettingPropertyType", "InstanceLogStatus", "INSTANCE_LOG_TRANSIENT_STATUSES", diff --git a/scaleway/scaleway/rdb/v1/marshalling.py b/scaleway/scaleway/rdb/v1/marshalling.py index a480738f..4d244064 100644 --- a/scaleway/scaleway/rdb/v1/marshalling.py +++ b/scaleway/scaleway/rdb/v1/marshalling.py @@ -140,6 +140,10 @@ def unmarshal_EndpointPrivateNetworkDetails(data: Any) -> EndpointPrivateNetwork if field is not None: args["zone"] = field + field = data.get("provisioning_mode", None) + if field is not None: + args["provisioning_mode"] = field + return EndpointPrivateNetworkDetails(**args) diff --git a/scaleway/scaleway/rdb/v1/types.py b/scaleway/scaleway/rdb/v1/types.py index ef41a5e2..21fe9974 100644 --- a/scaleway/scaleway/rdb/v1/types.py +++ b/scaleway/scaleway/rdb/v1/types.py @@ -56,6 +56,14 @@ def __str__(self) -> str: return str(self.value) +class EndpointPrivateNetworkDetailsProvisioningMode(str, Enum, metaclass=StrEnumMeta): + STATIC = "static" + IPAM = "ipam" + + def __str__(self) -> str: + return str(self.value) + + class EngineSettingPropertyType(str, Enum, metaclass=StrEnumMeta): BOOLEAN = "boolean" INT = "int" @@ -286,6 +294,11 @@ class EndpointPrivateNetworkDetails: Private network zone. """ + provisioning_mode: EndpointPrivateNetworkDetailsProvisioningMode + """ + How endpoint ips are provisioned. + """ + @dataclass class EndpointSpecPrivateNetworkIpamConfig: