Skip to content

Commit 76c47c5

Browse files
committed
feat: update generated APIs
1 parent c9d82c0 commit 76c47c5

File tree

12 files changed

+116
-0
lines changed

12 files changed

+116
-0
lines changed

scaleway-async/scaleway_async/baremetal/v1/api.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from scaleway_core.api import API
88
from scaleway_core.bridge import (
9+
ScwFile,
910
Zone as ScwZone,
1011
)
1112
from scaleway_core.utils import (
@@ -288,6 +289,7 @@ async def create_server(
288289
tags: Optional[list[str]] = None,
289290
install: Optional[CreateServerRequestInstall] = None,
290291
option_ids: Optional[list[str]] = None,
292+
user_data: Optional[str] = None,
291293
) -> Server:
292294
"""
293295
Create an Elastic Metal server.
@@ -304,6 +306,7 @@ async def create_server(
304306
:param tags: Tags to associate to the server.
305307
:param install: Object describing the configuration details of the OS installation on the server.
306308
:param option_ids: IDs of options to enable on server.
309+
:param user_data: Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
307310
:return: :class:`Server <Server>`
308311
309312
Usage:
@@ -332,6 +335,7 @@ async def create_server(
332335
tags=tags,
333336
install=install,
334337
option_ids=option_ids,
338+
user_data=user_data,
335339
project_id=project_id,
336340
organization_id=organization_id,
337341
),
@@ -351,6 +355,7 @@ async def update_server(
351355
description: Optional[str] = None,
352356
tags: Optional[list[str]] = None,
353357
protected: Optional[bool] = None,
358+
user_data: Optional[str] = None,
354359
) -> Server:
355360
"""
356361
Update an Elastic Metal server.
@@ -361,6 +366,7 @@ async def update_server(
361366
:param description: Description associated with the server, max 255 characters, not updated if null.
362367
:param tags: Tags associated with the server, not updated if null.
363368
:param protected: If enabled, the server can not be deleted.
369+
:param user_data: Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
364370
:return: :class:`Server <Server>`
365371
366372
Usage:
@@ -385,6 +391,7 @@ async def update_server(
385391
description=description,
386392
tags=tags,
387393
protected=protected,
394+
user_data=user_data,
388395
),
389396
self.client,
390397
),
@@ -406,6 +413,7 @@ async def install_server(
406413
service_user: Optional[str] = None,
407414
service_password: Optional[str] = None,
408415
partitioning_schema: Optional[Schema] = None,
416+
user_data: Optional[ScwFile] = None,
409417
) -> Server:
410418
"""
411419
Install an Elastic Metal server.
@@ -420,6 +428,7 @@ async def install_server(
420428
:param service_user: User used for the service to install.
421429
:param service_password: Password used for the service to install.
422430
:param partitioning_schema: Partitioning schema.
431+
:param user_data: Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
423432
:return: :class:`Server <Server>`
424433
425434
Usage:
@@ -451,6 +460,7 @@ async def install_server(
451460
service_user=service_user,
452461
service_password=service_password,
453462
partitioning_schema=partitioning_schema,
463+
user_data=user_data,
454464
),
455465
self.client,
456466
),

scaleway-async/scaleway_async/baremetal/v1/marshalling.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from scaleway_core.profile import ProfileDefaults
88
from scaleway_core.bridge import (
99
unmarshal_Money,
10+
marshal_ScwFile,
1011
unmarshal_TimeSeries,
1112
)
1213
from scaleway_core.utils import (
@@ -706,6 +707,12 @@ def unmarshal_Server(data: Any) -> Server:
706707
else:
707708
args["rescue_server"] = None
708709

710+
field = data.get("user_data", None)
711+
if field is not None:
712+
args["user_data"] = field
713+
else:
714+
args["user_data"] = None
715+
709716
return Server(**args)
710717

711718

@@ -1930,6 +1937,9 @@ def marshal_CreateServerRequest(
19301937
if request.option_ids is not None:
19311938
output["option_ids"] = request.option_ids
19321939

1940+
if request.user_data is not None:
1941+
output["user_data"] = request.user_data
1942+
19331943
return output
19341944

19351945

@@ -1977,6 +1987,9 @@ def marshal_InstallServerRequest(
19771987
request.partitioning_schema, defaults
19781988
)
19791989

1990+
if request.user_data is not None:
1991+
output["user_data"] = marshal_ScwFile(request.user_data, defaults)
1992+
19801993
return output
19811994

19821995

@@ -2076,6 +2089,9 @@ def marshal_UpdateServerRequest(
20762089
if request.protected is not None:
20772090
output["protected"] = request.protected
20782091

2092+
if request.user_data is not None:
2093+
output["user_data"] = request.user_data
2094+
20792095
return output
20802096

20812097

scaleway-async/scaleway_async/baremetal/v1/types.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
from scaleway_core.bridge import (
1111
Money,
12+
ScwFile,
1213
TimeSeries,
1314
Zone as ScwZone,
1415
)
@@ -661,6 +662,11 @@ class CreateServerRequest:
661662
IDs of options to enable on server.
662663
"""
663664

665+
user_data: Optional[str] = None
666+
"""
667+
Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
668+
"""
669+
664670
project_id: Optional[str] = None
665671

666672
organization_id: Optional[str] = None
@@ -768,6 +774,11 @@ class Server:
768774
Configuration of rescue boot.
769775
"""
770776

777+
user_data: Optional[str] = None
778+
"""
779+
Optional configuration data passed to cloud-init.
780+
"""
781+
771782

772783
@dataclass
773784
class OS:
@@ -1325,6 +1336,11 @@ class InstallServerRequest:
13251336
Partitioning schema.
13261337
"""
13271338

1339+
user_data: Optional[ScwFile] = None
1340+
"""
1341+
Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
1342+
"""
1343+
13281344

13291345
@dataclass
13301346
class ListOSRequest:
@@ -1868,6 +1884,11 @@ class UpdateServerRequest:
18681884
If enabled, the server can not be deleted.
18691885
"""
18701886

1887+
user_data: Optional[str] = None
1888+
"""
1889+
Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
1890+
"""
1891+
18711892

18721893
@dataclass
18731894
class UpdateSettingRequest:

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2405,13 +2405,15 @@ async def update_api_key(
24052405
access_key: str,
24062406
default_project_id: Optional[str] = None,
24072407
description: Optional[str] = None,
2408+
expires_at: Optional[datetime] = None,
24082409
) -> APIKey:
24092410
"""
24102411
Update an API key.
24112412
Update the parameters of an API key, including `default_project_id` and `description`.
24122413
:param access_key: Access key to update.
24132414
:param default_project_id: New default Project ID to set.
24142415
:param description: New description to update.
2416+
:param expires_at: New expiration date of the API key.
24152417
:return: :class:`APIKey <APIKey>`
24162418
24172419
Usage:
@@ -2432,6 +2434,7 @@ async def update_api_key(
24322434
access_key=access_key,
24332435
default_project_id=default_project_id,
24342436
description=description,
2437+
expires_at=expires_at,
24352438
),
24362439
self.client,
24372440
),

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2161,6 +2161,9 @@ def marshal_UpdateAPIKeyRequest(
21612161
if request.description is not None:
21622162
output["description"] = request.description
21632163

2164+
if request.expires_at is not None:
2165+
output["expires_at"] = request.expires_at.isoformat()
2166+
21642167
return output
21652168

21662169

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2276,6 +2276,11 @@ class UpdateAPIKeyRequest:
22762276
New description to update.
22772277
"""
22782278

2279+
expires_at: Optional[datetime] = None
2280+
"""
2281+
New expiration date of the API key.
2282+
"""
2283+
22792284

22802285
@dataclass
22812286
class UpdateApplicationRequest:

scaleway/scaleway/baremetal/v1/api.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from scaleway_core.api import API
88
from scaleway_core.bridge import (
9+
ScwFile,
910
Zone as ScwZone,
1011
)
1112
from scaleway_core.utils import (
@@ -288,6 +289,7 @@ def create_server(
288289
tags: Optional[list[str]] = None,
289290
install: Optional[CreateServerRequestInstall] = None,
290291
option_ids: Optional[list[str]] = None,
292+
user_data: Optional[str] = None,
291293
) -> Server:
292294
"""
293295
Create an Elastic Metal server.
@@ -304,6 +306,7 @@ def create_server(
304306
:param tags: Tags to associate to the server.
305307
:param install: Object describing the configuration details of the OS installation on the server.
306308
:param option_ids: IDs of options to enable on server.
309+
:param user_data: Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
307310
:return: :class:`Server <Server>`
308311
309312
Usage:
@@ -332,6 +335,7 @@ def create_server(
332335
tags=tags,
333336
install=install,
334337
option_ids=option_ids,
338+
user_data=user_data,
335339
project_id=project_id,
336340
organization_id=organization_id,
337341
),
@@ -351,6 +355,7 @@ def update_server(
351355
description: Optional[str] = None,
352356
tags: Optional[list[str]] = None,
353357
protected: Optional[bool] = None,
358+
user_data: Optional[str] = None,
354359
) -> Server:
355360
"""
356361
Update an Elastic Metal server.
@@ -361,6 +366,7 @@ def update_server(
361366
:param description: Description associated with the server, max 255 characters, not updated if null.
362367
:param tags: Tags associated with the server, not updated if null.
363368
:param protected: If enabled, the server can not be deleted.
369+
:param user_data: Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
364370
:return: :class:`Server <Server>`
365371
366372
Usage:
@@ -385,6 +391,7 @@ def update_server(
385391
description=description,
386392
tags=tags,
387393
protected=protected,
394+
user_data=user_data,
388395
),
389396
self.client,
390397
),
@@ -406,6 +413,7 @@ def install_server(
406413
service_user: Optional[str] = None,
407414
service_password: Optional[str] = None,
408415
partitioning_schema: Optional[Schema] = None,
416+
user_data: Optional[ScwFile] = None,
409417
) -> Server:
410418
"""
411419
Install an Elastic Metal server.
@@ -420,6 +428,7 @@ def install_server(
420428
:param service_user: User used for the service to install.
421429
:param service_password: Password used for the service to install.
422430
:param partitioning_schema: Partitioning schema.
431+
:param user_data: Configuration data to pass to cloud-init such as a YAML cloud config data or a user-data script.
423432
:return: :class:`Server <Server>`
424433
425434
Usage:
@@ -451,6 +460,7 @@ def install_server(
451460
service_user=service_user,
452461
service_password=service_password,
453462
partitioning_schema=partitioning_schema,
463+
user_data=user_data,
454464
),
455465
self.client,
456466
),

scaleway/scaleway/baremetal/v1/marshalling.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from scaleway_core.profile import ProfileDefaults
88
from scaleway_core.bridge import (
99
unmarshal_Money,
10+
marshal_ScwFile,
1011
unmarshal_TimeSeries,
1112
)
1213
from scaleway_core.utils import (
@@ -706,6 +707,12 @@ def unmarshal_Server(data: Any) -> Server:
706707
else:
707708
args["rescue_server"] = None
708709

710+
field = data.get("user_data", None)
711+
if field is not None:
712+
args["user_data"] = field
713+
else:
714+
args["user_data"] = None
715+
709716
return Server(**args)
710717

711718

@@ -1930,6 +1937,9 @@ def marshal_CreateServerRequest(
19301937
if request.option_ids is not None:
19311938
output["option_ids"] = request.option_ids
19321939

1940+
if request.user_data is not None:
1941+
output["user_data"] = request.user_data
1942+
19331943
return output
19341944

19351945

@@ -1977,6 +1987,9 @@ def marshal_InstallServerRequest(
19771987
request.partitioning_schema, defaults
19781988
)
19791989

1990+
if request.user_data is not None:
1991+
output["user_data"] = marshal_ScwFile(request.user_data, defaults)
1992+
19801993
return output
19811994

19821995

@@ -2076,6 +2089,9 @@ def marshal_UpdateServerRequest(
20762089
if request.protected is not None:
20772090
output["protected"] = request.protected
20782091

2092+
if request.user_data is not None:
2093+
output["user_data"] = request.user_data
2094+
20792095
return output
20802096

20812097

0 commit comments

Comments
 (0)