diff --git a/scaleway-async/scaleway_async/mongodb/v1alpha1/__init__.py b/scaleway-async/scaleway_async/mongodb/v1alpha1/__init__.py index ead557620..c7106938c 100644 --- a/scaleway-async/scaleway_async/mongodb/v1alpha1/__init__.py +++ b/scaleway-async/scaleway_async/mongodb/v1alpha1/__init__.py @@ -31,6 +31,7 @@ from .types import CreateInstanceRequest from .types import CreateSnapshotRequest from .types import CreateUserRequest +from .types import DeleteEndpointRequest from .types import DeleteInstanceRequest from .types import DeleteSnapshotRequest from .types import GetInstanceCertificateRequest @@ -85,6 +86,7 @@ "CreateInstanceRequest", "CreateSnapshotRequest", "CreateUserRequest", + "DeleteEndpointRequest", "DeleteInstanceRequest", "DeleteSnapshotRequest", "GetInstanceCertificateRequest", diff --git a/scaleway-async/scaleway_async/mongodb/v1alpha1/api.py b/scaleway-async/scaleway_async/mongodb/v1alpha1/api.py index 980843a92..a9b838f0b 100644 --- a/scaleway-async/scaleway_async/mongodb/v1alpha1/api.py +++ b/scaleway-async/scaleway_async/mongodb/v1alpha1/api.py @@ -1169,3 +1169,35 @@ async def update_user( self._throw_on_error(res) return unmarshal_User(res.json()) + + async def delete_endpoint( + self, + *, + endpoint_id: str, + region: Optional[Region] = None, + ) -> None: + """ + Delete a Database Instance endpoint. + Delete the endpoint of a Database Instance. You must specify the `endpoint_id` parameter of the endpoint you want to delete. Note that you might need to update any environment configurations that point to the deleted endpoint. + :param endpoint_id: UUID of the Endpoint to delete. + :param region: Region to target. If none is passed will use default region from the config. + + Usage: + :: + + result = await api.delete_endpoint( + endpoint_id="example", + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_endpoint_id = validate_path_param("endpoint_id", endpoint_id) + + res = self._request( + "DELETE", + f"/mongodb/v1alpha1/regions/{param_region}/endpoints/{param_endpoint_id}", + ) + + self._throw_on_error(res) diff --git a/scaleway-async/scaleway_async/mongodb/v1alpha1/types.py b/scaleway-async/scaleway_async/mongodb/v1alpha1/types.py index 9fd17e352..29319e3db 100644 --- a/scaleway-async/scaleway_async/mongodb/v1alpha1/types.py +++ b/scaleway-async/scaleway_async/mongodb/v1alpha1/types.py @@ -615,6 +615,19 @@ class CreateUserRequest: """ +@dataclass +class DeleteEndpointRequest: + endpoint_id: str + """ + UUID of the Endpoint to delete. + """ + + region: Optional[Region] + """ + Region to target. If none is passed will use default region from the config. + """ + + @dataclass class DeleteInstanceRequest: instance_id: str diff --git a/scaleway/scaleway/mongodb/v1alpha1/__init__.py b/scaleway/scaleway/mongodb/v1alpha1/__init__.py index ead557620..c7106938c 100644 --- a/scaleway/scaleway/mongodb/v1alpha1/__init__.py +++ b/scaleway/scaleway/mongodb/v1alpha1/__init__.py @@ -31,6 +31,7 @@ from .types import CreateInstanceRequest from .types import CreateSnapshotRequest from .types import CreateUserRequest +from .types import DeleteEndpointRequest from .types import DeleteInstanceRequest from .types import DeleteSnapshotRequest from .types import GetInstanceCertificateRequest @@ -85,6 +86,7 @@ "CreateInstanceRequest", "CreateSnapshotRequest", "CreateUserRequest", + "DeleteEndpointRequest", "DeleteInstanceRequest", "DeleteSnapshotRequest", "GetInstanceCertificateRequest", diff --git a/scaleway/scaleway/mongodb/v1alpha1/api.py b/scaleway/scaleway/mongodb/v1alpha1/api.py index dfb7c6236..b42d234df 100644 --- a/scaleway/scaleway/mongodb/v1alpha1/api.py +++ b/scaleway/scaleway/mongodb/v1alpha1/api.py @@ -1165,3 +1165,35 @@ def update_user( self._throw_on_error(res) return unmarshal_User(res.json()) + + def delete_endpoint( + self, + *, + endpoint_id: str, + region: Optional[Region] = None, + ) -> None: + """ + Delete a Database Instance endpoint. + Delete the endpoint of a Database Instance. You must specify the `endpoint_id` parameter of the endpoint you want to delete. Note that you might need to update any environment configurations that point to the deleted endpoint. + :param endpoint_id: UUID of the Endpoint to delete. + :param region: Region to target. If none is passed will use default region from the config. + + Usage: + :: + + result = api.delete_endpoint( + endpoint_id="example", + ) + """ + + param_region = validate_path_param( + "region", region or self.client.default_region + ) + param_endpoint_id = validate_path_param("endpoint_id", endpoint_id) + + res = self._request( + "DELETE", + f"/mongodb/v1alpha1/regions/{param_region}/endpoints/{param_endpoint_id}", + ) + + self._throw_on_error(res) diff --git a/scaleway/scaleway/mongodb/v1alpha1/types.py b/scaleway/scaleway/mongodb/v1alpha1/types.py index 9fd17e352..29319e3db 100644 --- a/scaleway/scaleway/mongodb/v1alpha1/types.py +++ b/scaleway/scaleway/mongodb/v1alpha1/types.py @@ -615,6 +615,19 @@ class CreateUserRequest: """ +@dataclass +class DeleteEndpointRequest: + endpoint_id: str + """ + UUID of the Endpoint to delete. + """ + + region: Optional[Region] + """ + Region to target. If none is passed will use default region from the config. + """ + + @dataclass class DeleteInstanceRequest: instance_id: str