Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions scaleway-async/scaleway_async/k8s/v1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,18 +838,18 @@ def unmarshal_Pool(data: Any) -> Pool:
else:
args["startup_taints"] = []

field = data.get("private_network_id", None)
if field is not None:
args["private_network_id"] = field
else:
args["private_network_id"] = None

field = data.get("region", None)
if field is not None:
args["region"] = field
else:
args["region"] = None

field = data.get("private_network_id", None)
if field is not None:
args["private_network_id"] = field
else:
args["private_network_id"] = None

return Pool(**args)


Expand Down
10 changes: 5 additions & 5 deletions scaleway-async/scaleway_async/k8s/v1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1078,11 +1078,6 @@ class Pool:
Kubernetes taints applied at node creation but not reconciled afterwards.
"""

private_network_id: str
"""
Private network where the nodes are attached. Should be member of the same VPC as the API Server.
"""

region: ScwRegion
"""
Cluster region of the pool.
Expand Down Expand Up @@ -1113,6 +1108,11 @@ class Pool:
System volume disk size.
"""

private_network_id: Optional[str] = None
"""
Private network where the nodes are attached. Should be member of the same VPC as the API Server.
"""


@dataclass
class NodeMetadataCoreV1Taint:
Expand Down
1 change: 1 addition & 0 deletions scaleway-async/scaleway_async/search/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class ResourceType(str, Enum, metaclass=StrEnumMeta):
IAM_GROUP = "iam_group"
IAM_POLICY = "iam_policy"
SEDB_CLUSTER = "sedb_cluster"
AUTOSCALING_GROUP = "autoscaling_group"

def __str__(self) -> str:
return str(self.value)
Expand Down
14 changes: 6 additions & 8 deletions scaleway-async/scaleway_async/searchdb/v1alpha1/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ async def create_deployment(
self,
*,
name: str,
node_amount: int,
node_count: int,
node_type: str,
version: str,
region: Optional[ScwRegion] = None,
project_id: Optional[str] = None,
tags: Optional[list[str]] = None,
node_amount: Optional[int] = None,
node_count: Optional[int] = None,
user_name: Optional[str] = None,
password: Optional[str] = None,
volume: Optional[Volume] = None,
Expand All @@ -82,13 +82,13 @@ async def create_deployment(
"""
Create a new Cloud Essentials for OpenSearch deployment.
:param name: Name of the deployment.
:param node_amount: DEPRECATED: Use node_count instead. Number of nodes.
:param node_count: Number of nodes.
:param node_type: Node type.
:param version: The Opensearch version to use.
:param region: Region to target. If none is passed will use default region from the config.
:param project_id: Project ID in which to create the deployment.
:param tags: Tags.
:param node_amount: DEPRECATED: Use node_count instead. Number of nodes.
:param node_count: Number of nodes.
:param user_name: Username for the deployment user.
:param password: Password for the deployment user.
:param volume: Volume.
Expand All @@ -100,8 +100,6 @@ async def create_deployment(

result = await api.create_deployment(
name="example",
node_amount=1,
node_count=1,
node_type="example",
version="example",
)
Expand All @@ -117,13 +115,13 @@ async def create_deployment(
body=marshal_CreateDeploymentRequest(
CreateDeploymentRequest(
name=name,
node_amount=node_amount,
node_count=node_count,
node_type=node_type,
version=version,
region=region,
project_id=project_id,
tags=tags,
node_amount=node_amount,
node_count=node_count,
user_name=user_name,
password=password,
volume=volume,
Expand Down
12 changes: 6 additions & 6 deletions scaleway-async/scaleway_async/searchdb/v1alpha1/marshalling.py
Original file line number Diff line number Diff line change
Expand Up @@ -599,12 +599,6 @@ def marshal_CreateDeploymentRequest(
if request.name is not None:
output["name"] = request.name

if request.node_amount is not None:
output["node_amount"] = request.node_amount

if request.node_count is not None:
output["node_count"] = request.node_count

if request.node_type is not None:
output["node_type"] = request.node_type

Expand All @@ -619,6 +613,12 @@ def marshal_CreateDeploymentRequest(
if request.tags is not None:
output["tags"] = request.tags

if request.node_amount is not None:
output["node_amount"] = request.node_amount

if request.node_count is not None:
output["node_count"] = request.node_count

if request.user_name is not None:
output["user_name"] = request.user_name

Expand Down
20 changes: 10 additions & 10 deletions scaleway-async/scaleway_async/searchdb/v1alpha1/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,16 +353,6 @@ class CreateDeploymentRequest:
Name of the deployment.
"""

node_amount: int
"""
DEPRECATED: Use node_count instead. Number of nodes.
"""

node_count: int
"""
Number of nodes.
"""

node_type: str
"""
Node type.
Expand All @@ -388,6 +378,16 @@ class CreateDeploymentRequest:
Tags.
"""

node_amount: Optional[int] = 0
"""
DEPRECATED: Use node_count instead. Number of nodes.
"""

node_count: Optional[int] = 0
"""
Number of nodes.
"""

user_name: Optional[str] = None
"""
Username for the deployment user.
Expand Down
8 changes: 0 additions & 8 deletions scaleway-async/scaleway_async/vpc/v2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
from .types import ListSubnetOverlapsResponseSubnetOverlap
from .types import VPCConnector
from .types import VPC
from .types import AddSubnetsRequest
from .types import AddSubnetsResponse
from .types import CreateIngressRuleRequest
from .types import CreatePrivateNetworkRequest
from .types import CreateRouteRequest
Expand All @@ -29,8 +27,6 @@
from .types import DeleteIngressRuleRequest
from .types import DeletePrivateNetworkRequest
from .types import DeleteRouteRequest
from .types import DeleteSubnetsRequest
from .types import DeleteSubnetsResponse
from .types import DeleteVPCConnectorRequest
from .types import DeleteVPCRequest
from .types import EnableCustomRoutesPropagationRequest
Expand Down Expand Up @@ -84,8 +80,6 @@
"ListSubnetOverlapsResponseSubnetOverlap",
"VPCConnector",
"VPC",
"AddSubnetsRequest",
"AddSubnetsResponse",
"CreateIngressRuleRequest",
"CreatePrivateNetworkRequest",
"CreateRouteRequest",
Expand All @@ -94,8 +88,6 @@
"DeleteIngressRuleRequest",
"DeletePrivateNetworkRequest",
"DeleteRouteRequest",
"DeleteSubnetsRequest",
"DeleteSubnetsResponse",
"DeleteVPCConnectorRequest",
"DeleteVPCRequest",
"EnableCustomRoutesPropagationRequest",
Expand Down
100 changes: 0 additions & 100 deletions scaleway-async/scaleway_async/vpc/v2/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,11 @@
ListVPCsRequestOrderBy,
VPCConnectorStatus,
AclRule,
AddSubnetsRequest,
AddSubnetsResponse,
CreateIngressRuleRequest,
CreatePrivateNetworkRequest,
CreateRouteRequest,
CreateVPCConnectorRequest,
CreateVPCRequest,
DeleteSubnetsRequest,
DeleteSubnetsResponse,
GetAclResponse,
IngressRule,
ListIngressRulesResponse,
Expand Down Expand Up @@ -59,8 +55,6 @@
unmarshal_IngressRule,
unmarshal_VPCConnector,
unmarshal_VPC,
unmarshal_AddSubnetsResponse,
unmarshal_DeleteSubnetsResponse,
unmarshal_GetAclResponse,
unmarshal_ListIngressRulesResponse,
unmarshal_ListPrivateNetworksResponse,
Expand All @@ -69,13 +63,11 @@
unmarshal_ListVPCConnectorsResponse,
unmarshal_ListVPCsResponse,
unmarshal_SetAclResponse,
marshal_AddSubnetsRequest,
marshal_CreateIngressRuleRequest,
marshal_CreatePrivateNetworkRequest,
marshal_CreateRouteRequest,
marshal_CreateVPCConnectorRequest,
marshal_CreateVPCRequest,
marshal_DeleteSubnetsRequest,
marshal_SetAclRequest,
marshal_UpdateIngressRuleRequest,
marshal_UpdatePrivateNetworkRequest,
Expand Down Expand Up @@ -870,98 +862,6 @@ async def list_subnets_all(
},
)

async def add_subnets(
self,
*,
private_network_id: str,
region: Optional[ScwRegion] = None,
subnets: Optional[list[str]] = None,
) -> AddSubnetsResponse:
"""
Add subnets to a Private Network.
Add new subnets to an existing Private Network.
:param private_network_id: Private Network ID.
:param region: Region to target. If none is passed will use default region from the config.
:param subnets: Private Network subnets CIDR.
:return: :class:`AddSubnetsResponse <AddSubnetsResponse>`

Usage:
::

result = await api.add_subnets(
private_network_id="example",
)
"""

param_region = validate_path_param(
"region", region or self.client.default_region
)
param_private_network_id = validate_path_param(
"private_network_id", private_network_id
)

res = self._request(
"POST",
f"/vpc/v2/regions/{param_region}/private-networks/{param_private_network_id}/subnets",
body=marshal_AddSubnetsRequest(
AddSubnetsRequest(
private_network_id=private_network_id,
region=region,
subnets=subnets,
),
self.client,
),
)

self._throw_on_error(res)
return unmarshal_AddSubnetsResponse(res.json())

async def delete_subnets(
self,
*,
private_network_id: str,
region: Optional[ScwRegion] = None,
subnets: Optional[list[str]] = None,
) -> DeleteSubnetsResponse:
"""
Delete subnets from a Private Network.
Delete the specified subnets from a Private Network.
:param private_network_id: Private Network ID.
:param region: Region to target. If none is passed will use default region from the config.
:param subnets: Private Network subnets CIDR.
:return: :class:`DeleteSubnetsResponse <DeleteSubnetsResponse>`

Usage:
::

result = await api.delete_subnets(
private_network_id="example",
)
"""

param_region = validate_path_param(
"region", region or self.client.default_region
)
param_private_network_id = validate_path_param(
"private_network_id", private_network_id
)

res = self._request(
"DELETE",
f"/vpc/v2/regions/{param_region}/private-networks/{param_private_network_id}/subnets",
body=marshal_DeleteSubnetsRequest(
DeleteSubnetsRequest(
private_network_id=private_network_id,
region=region,
subnets=subnets,
),
self.client,
),
)

self._throw_on_error(res)
return unmarshal_DeleteSubnetsResponse(res.json())

async def create_route(
self,
*,
Expand Down
Loading
Loading