Skip to content

Commit 27a1e40

Browse files
authored
feat(searchdb): add GetDeploymentCertificateAuthority (scaleway#1555)
1 parent b4b7af0 commit 27a1e40

File tree

6 files changed

+90
-0
lines changed

6 files changed

+90
-0
lines changed

scaleway-async/scaleway_async/searchdb/v1alpha1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from .types import DeleteDeploymentRequest
2828
from .types import DeleteEndpointRequest
2929
from .types import DeleteUserRequest
30+
from .types import GetDeploymentCertificateAuthorityRequest
3031
from .types import GetDeploymentRequest
3132
from .types import ListDeploymentsRequest
3233
from .types import ListDeploymentsResponse
@@ -69,6 +70,7 @@
6970
"DeleteDeploymentRequest",
7071
"DeleteEndpointRequest",
7172
"DeleteUserRequest",
73+
"GetDeploymentCertificateAuthorityRequest",
7274
"GetDeploymentRequest",
7375
"ListDeploymentsRequest",
7476
"ListDeploymentsResponse",

scaleway-async/scaleway_async/searchdb/v1alpha1/api.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
from scaleway_core.api import API
77
from scaleway_core.bridge import (
88
Region as ScwRegion,
9+
ScwFile,
10+
unmarshal_ScwFile,
911
)
1012
from scaleway_core.utils import (
1113
WaitForOptions,
@@ -876,3 +878,35 @@ async def delete_user(
876878
)
877879

878880
self._throw_on_error(res)
881+
882+
async def get_deployment_certificate_authority(
883+
self,
884+
*,
885+
deployment_id: str,
886+
region: Optional[ScwRegion] = None,
887+
) -> ScwFile:
888+
"""
889+
:param deployment_id:
890+
:param region: Region to target. If none is passed will use default region from the config.
891+
:return: :class:`ScwFile <ScwFile>`
892+
893+
Usage:
894+
::
895+
896+
result = await api.get_deployment_certificate_authority(
897+
deployment_id="example",
898+
)
899+
"""
900+
901+
param_region = validate_path_param(
902+
"region", region or self.client.default_region
903+
)
904+
param_deployment_id = validate_path_param("deployment_id", deployment_id)
905+
906+
res = self._request(
907+
"GET",
908+
f"/searchdb/v1alpha1/regions/{param_region}/deployments/{param_deployment_id}/certificate-authority",
909+
)
910+
911+
self._throw_on_error(res)
912+
return unmarshal_ScwFile(res.json())

scaleway-async/scaleway_async/searchdb/v1alpha1/types.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,15 @@ class DeleteUserRequest:
504504
"""
505505

506506

507+
@dataclass
508+
class GetDeploymentCertificateAuthorityRequest:
509+
deployment_id: str
510+
region: Optional[ScwRegion] = None
511+
"""
512+
Region to target. If none is passed will use default region from the config.
513+
"""
514+
515+
507516
@dataclass
508517
class GetDeploymentRequest:
509518
"""

scaleway/scaleway/searchdb/v1alpha1/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from .types import DeleteDeploymentRequest
2828
from .types import DeleteEndpointRequest
2929
from .types import DeleteUserRequest
30+
from .types import GetDeploymentCertificateAuthorityRequest
3031
from .types import GetDeploymentRequest
3132
from .types import ListDeploymentsRequest
3233
from .types import ListDeploymentsResponse
@@ -69,6 +70,7 @@
6970
"DeleteDeploymentRequest",
7071
"DeleteEndpointRequest",
7172
"DeleteUserRequest",
73+
"GetDeploymentCertificateAuthorityRequest",
7274
"GetDeploymentRequest",
7375
"ListDeploymentsRequest",
7476
"ListDeploymentsResponse",

scaleway/scaleway/searchdb/v1alpha1/api.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
from scaleway_core.api import API
77
from scaleway_core.bridge import (
88
Region as ScwRegion,
9+
ScwFile,
10+
unmarshal_ScwFile,
911
)
1012
from scaleway_core.utils import (
1113
WaitForOptions,
@@ -874,3 +876,35 @@ def delete_user(
874876
)
875877

876878
self._throw_on_error(res)
879+
880+
def get_deployment_certificate_authority(
881+
self,
882+
*,
883+
deployment_id: str,
884+
region: Optional[ScwRegion] = None,
885+
) -> ScwFile:
886+
"""
887+
:param deployment_id:
888+
:param region: Region to target. If none is passed will use default region from the config.
889+
:return: :class:`ScwFile <ScwFile>`
890+
891+
Usage:
892+
::
893+
894+
result = api.get_deployment_certificate_authority(
895+
deployment_id="example",
896+
)
897+
"""
898+
899+
param_region = validate_path_param(
900+
"region", region or self.client.default_region
901+
)
902+
param_deployment_id = validate_path_param("deployment_id", deployment_id)
903+
904+
res = self._request(
905+
"GET",
906+
f"/searchdb/v1alpha1/regions/{param_region}/deployments/{param_deployment_id}/certificate-authority",
907+
)
908+
909+
self._throw_on_error(res)
910+
return unmarshal_ScwFile(res.json())

scaleway/scaleway/searchdb/v1alpha1/types.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,15 @@ class DeleteUserRequest:
504504
"""
505505

506506

507+
@dataclass
508+
class GetDeploymentCertificateAuthorityRequest:
509+
deployment_id: str
510+
region: Optional[ScwRegion] = None
511+
"""
512+
Region to target. If none is passed will use default region from the config.
513+
"""
514+
515+
507516
@dataclass
508517
class GetDeploymentRequest:
509518
"""

0 commit comments

Comments
 (0)