Skip to content

Commit 0a3f919

Browse files
authored
Merge branch 'main' into dependabot/pip/scaleway/ruff-0.7.1
2 parents 242a46b + fe39d64 commit 0a3f919

File tree

28 files changed

+1198
-4
lines changed

28 files changed

+1198
-4
lines changed

scaleway-async/scaleway_async/applesilicon/v1alpha1/marshalling.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,10 @@ def unmarshal_Server(data: Any) -> Server:
266266
if field is not None:
267267
args["sudo_password"] = field
268268

269+
field = data.get("vnc_port", None)
270+
if field is not None:
271+
args["vnc_port"] = field
272+
269273
field = data.get("status", None)
270274
if field is not None:
271275
args["status"] = field

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,11 @@ class Server:
225225
Admin password required to execute commands.
226226
"""
227227

228+
vnc_port: int
229+
"""
230+
VNC port to use for remote desktop connection.
231+
"""
232+
228233
status: ServerStatus
229234
"""
230235
Current status of the server.

scaleway-async/scaleway_async/container/v1beta1/api.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ async def create_container(
630630
:param local_storage_limit: Local storage limit of the container (in MB).
631631
:param scaling_option: Possible values:
632632
- concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance.
633+
- cpu_usage_threshold: Scale depending on the CPU usage of a container instance.
633634
:return: :class:`Container <Container>`
634635
635636
Usage:
@@ -728,6 +729,7 @@ async def update_container(
728729
:param local_storage_limit: Local storage limit of the container (in MB).
729730
:param scaling_option: Possible values:
730731
- concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance.
732+
- cpu_usage_threshold: Scale depending on the CPU usage of a container instance.
731733
:return: :class:`Container <Container>`
732734
733735
Usage:

scaleway-async/scaleway_async/container/v1beta1/marshalling.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ def unmarshal_ContainerScalingOption(data: Any) -> ContainerScalingOption:
5959
else:
6060
args["concurrent_requests_threshold"] = None
6161

62+
field = data.get("cpu_usage_threshold", None)
63+
if field is not None:
64+
args["cpu_usage_threshold"] = field
65+
else:
66+
args["cpu_usage_threshold"] = None
67+
6268
return ContainerScalingOption(**args)
6369

6470

@@ -702,6 +708,7 @@ def marshal_ContainerScalingOption(
702708
"concurrent_requests_threshold",
703709
request.concurrent_requests_threshold,
704710
),
711+
OneOfPossibility("cpu_usage_threshold", request.cpu_usage_threshold),
705712
]
706713
),
707714
)

scaleway-async/scaleway_async/container/v1beta1/types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,8 @@ def __str__(self) -> str:
195195
class ContainerScalingOption:
196196
concurrent_requests_threshold: Optional[int]
197197

198+
cpu_usage_threshold: Optional[int]
199+
198200

199201
@dataclass
200202
class SecretHashedValue:
@@ -447,6 +449,7 @@ class Container:
447449
"""
448450
Possible values:
449451
- concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance.
452+
- cpu_usage_threshold: Scale depending on the CPU usage of a container instance.
450453
"""
451454

452455
created_at: Optional[datetime]
@@ -790,6 +793,7 @@ class CreateContainerRequest:
790793
"""
791794
Possible values:
792795
- concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance.
796+
- cpu_usage_threshold: Scale depending on the CPU usage of a container instance.
793797
"""
794798

795799

@@ -1462,6 +1466,7 @@ class UpdateContainerRequest:
14621466
"""
14631467
Possible values:
14641468
- concurrent_requests_threshold: Scale depending on the number of concurrent requests being processed per container instance.
1469+
- cpu_usage_threshold: Scale depending on the CPU usage of a container instance.
14651470
"""
14661471

14671472

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,12 @@
7878
from .types import ListSSHKeysResponse
7979
from .types import ListUsersRequest
8080
from .types import ListUsersResponse
81+
from .types import LockUserRequest
8182
from .types import RemoveGroupMemberRequest
8283
from .types import SetGroupMembersRequest
8384
from .types import SetRulesRequest
8485
from .types import SetRulesResponse
86+
from .types import UnlockUserRequest
8587
from .types import UpdateAPIKeyRequest
8688
from .types import UpdateApplicationRequest
8789
from .types import UpdateGroupRequest
@@ -170,10 +172,12 @@
170172
"ListSSHKeysResponse",
171173
"ListUsersRequest",
172174
"ListUsersResponse",
175+
"LockUserRequest",
173176
"RemoveGroupMemberRequest",
174177
"SetGroupMembersRequest",
175178
"SetRulesRequest",
176179
"SetRulesResponse",
180+
"UnlockUserRequest",
177181
"UpdateAPIKeyRequest",
178182
"UpdateApplicationRequest",
179183
"UpdateGroupRequest",

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

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,65 @@ async def update_user_password(
617617
self._throw_on_error(res)
618618
return unmarshal_User(res.json())
619619

620+
async def lock_user(
621+
self,
622+
*,
623+
user_id: str,
624+
) -> User:
625+
"""
626+
Lock a user.
627+
Lock a user. Note that a locked user cannot log in or use API keys until the locked status is removed.
628+
:param user_id:
629+
:return: :class:`User <User>`
630+
631+
Usage:
632+
::
633+
634+
result = await api.lock_user(
635+
user_id="example",
636+
)
637+
"""
638+
639+
param_user_id = validate_path_param("user_id", user_id)
640+
641+
res = self._request(
642+
"POST",
643+
f"/iam/v1alpha1/users/{param_user_id}/lock",
644+
body={},
645+
)
646+
647+
self._throw_on_error(res)
648+
return unmarshal_User(res.json())
649+
650+
async def unlock_user(
651+
self,
652+
*,
653+
user_id: str,
654+
) -> User:
655+
"""
656+
Unlock a user.
657+
:param user_id:
658+
:return: :class:`User <User>`
659+
660+
Usage:
661+
::
662+
663+
result = await api.unlock_user(
664+
user_id="example",
665+
)
666+
"""
667+
668+
param_user_id = validate_path_param("user_id", user_id)
669+
670+
res = self._request(
671+
"POST",
672+
f"/iam/v1alpha1/users/{param_user_id}/unlock",
673+
body={},
674+
)
675+
676+
self._throw_on_error(res)
677+
return unmarshal_User(res.json())
678+
620679
async def list_applications(
621680
self,
622681
*,

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,6 +1691,11 @@ class ListUsersResponse:
16911691
"""
16921692

16931693

1694+
@dataclass
1695+
class LockUserRequest:
1696+
user_id: str
1697+
1698+
16941699
@dataclass
16951700
class RemoveGroupMemberRequest:
16961701
group_id: str
@@ -1733,6 +1738,11 @@ class SetRulesResponse:
17331738
"""
17341739

17351740

1741+
@dataclass
1742+
class UnlockUserRequest:
1743+
user_id: str
1744+
1745+
17361746
@dataclass
17371747
class UpdateAPIKeyRequest:
17381748
access_key: str

scaleway-async/scaleway_async/k8s/v1/__init__.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
from .types import ClusterAutoscalerConfig
2525
from .types import ClusterOpenIDConnectConfig
2626
from .types import Pool
27+
from .types import ACLRuleRequest
28+
from .types import ACLRule
2729
from .types import CreateClusterRequestAutoUpgrade
2830
from .types import CreateClusterRequestAutoscalerConfig
2931
from .types import CreateClusterRequestOpenIDConnectConfig
@@ -39,10 +41,13 @@
3941
from .types import UpdateClusterRequestAutoscalerConfig
4042
from .types import UpdateClusterRequestOpenIDConnectConfig
4143
from .types import UpdatePoolRequestUpgradePolicy
44+
from .types import AddClusterACLRulesRequest
45+
from .types import AddClusterACLRulesResponse
4246
from .types import AuthExternalNodeRequest
4347
from .types import CreateClusterRequest
4448
from .types import CreateExternalNodeRequest
4549
from .types import CreatePoolRequest
50+
from .types import DeleteACLRuleRequest
4651
from .types import DeleteClusterRequest
4752
from .types import DeleteNodeRequest
4853
from .types import DeletePoolRequest
@@ -54,6 +59,8 @@
5459
from .types import GetNodeRequest
5560
from .types import GetPoolRequest
5661
from .types import GetVersionRequest
62+
from .types import ListClusterACLRulesRequest
63+
from .types import ListClusterACLRulesResponse
5764
from .types import ListClusterAvailableTypesRequest
5865
from .types import ListClusterAvailableTypesResponse
5966
from .types import ListClusterAvailableVersionsRequest
@@ -73,6 +80,8 @@
7380
from .types import RebootNodeRequest
7481
from .types import ReplaceNodeRequest
7582
from .types import ResetClusterAdminTokenRequest
83+
from .types import SetClusterACLRulesRequest
84+
from .types import SetClusterACLRulesResponse
7685
from .types import SetClusterTypeRequest
7786
from .types import UpdateClusterRequest
7887
from .types import UpdatePoolRequest
@@ -105,6 +114,8 @@
105114
"ClusterAutoscalerConfig",
106115
"ClusterOpenIDConnectConfig",
107116
"Pool",
117+
"ACLRuleRequest",
118+
"ACLRule",
108119
"CreateClusterRequestAutoUpgrade",
109120
"CreateClusterRequestAutoscalerConfig",
110121
"CreateClusterRequestOpenIDConnectConfig",
@@ -120,10 +131,13 @@
120131
"UpdateClusterRequestAutoscalerConfig",
121132
"UpdateClusterRequestOpenIDConnectConfig",
122133
"UpdatePoolRequestUpgradePolicy",
134+
"AddClusterACLRulesRequest",
135+
"AddClusterACLRulesResponse",
123136
"AuthExternalNodeRequest",
124137
"CreateClusterRequest",
125138
"CreateExternalNodeRequest",
126139
"CreatePoolRequest",
140+
"DeleteACLRuleRequest",
127141
"DeleteClusterRequest",
128142
"DeleteNodeRequest",
129143
"DeletePoolRequest",
@@ -135,6 +149,8 @@
135149
"GetNodeRequest",
136150
"GetPoolRequest",
137151
"GetVersionRequest",
152+
"ListClusterACLRulesRequest",
153+
"ListClusterACLRulesResponse",
138154
"ListClusterAvailableTypesRequest",
139155
"ListClusterAvailableTypesResponse",
140156
"ListClusterAvailableVersionsRequest",
@@ -154,6 +170,8 @@
154170
"RebootNodeRequest",
155171
"ReplaceNodeRequest",
156172
"ResetClusterAdminTokenRequest",
173+
"SetClusterACLRulesRequest",
174+
"SetClusterACLRulesResponse",
157175
"SetClusterTypeRequest",
158176
"UpdateClusterRequest",
159177
"UpdatePoolRequest",

0 commit comments

Comments
 (0)