Skip to content

Commit 92c695c

Browse files
authored
Merge branch 'main' into v1.5525.0
2 parents 7a6c8d4 + 8512ee7 commit 92c695c

File tree

23 files changed

+441
-66
lines changed

23 files changed

+441
-66
lines changed

.github/workflows/checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Install dependencies and library
3232
run: poetry install
3333
- name: Check format
34-
run: poetry run ruff format -q
34+
run: poetry run ruff format --check
3535

3636
typing:
3737
runs-on: ubuntu-latest

scaleway-async/poetry.lock

Lines changed: 20 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scaleway-async/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ scaleway-core = "*"
2828

2929
[tool.poetry.group.dev.dependencies]
3030
scaleway-core = { path = "../scaleway-core", develop = true }
31-
ruff = ">=0.5.0,<0.6.4"
31+
ruff = ">=0.5.0,<0.6.9"
3232
mypy = "^1.5.1"
3333

3434
[build-system]
3535
requires = ["poetry-core"]
3636
build-backend = "poetry.core.masonry.api"
3737

38-
[tool.ruff]
38+
[tool.ruff.lint]
3939
ignore = ["E501"]

scaleway-async/scaleway_async/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
"""Scaleway SDK for Python - Async"""
22

3-
import pkg_resources
3+
import importlib.metadata
44

5-
__version__: str = pkg_resources.get_distribution(__name__).version
5+
__version__: str = importlib.metadata.version(__name__)
66

77
from scaleway_core.api import (
88
API,

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ async def install_server(
398398
password: Optional[str] = None,
399399
service_user: Optional[str] = None,
400400
service_password: Optional[str] = None,
401+
partitioning_schema: Optional[Schema] = None,
401402
) -> Server:
402403
"""
403404
Install an Elastic Metal server.
@@ -411,6 +412,7 @@ async def install_server(
411412
:param password: Password used for the installation.
412413
:param service_user: User used for the service to install.
413414
:param service_password: Password used for the service to install.
415+
:param partitioning_schema: Partitioning schema.
414416
:return: :class:`Server <Server>`
415417
416418
Usage:
@@ -441,6 +443,7 @@ async def install_server(
441443
password=password,
442444
service_user=service_user,
443445
service_password=service_password,
446+
partitioning_schema=partitioning_schema,
444447
),
445448
self.client,
446449
),

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

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,12 @@ def unmarshal_ServerInstall(data: Any) -> ServerInstall:
894894
if field is not None:
895895
args["service_url"] = field
896896

897+
field = data.get("partitioning_schema", None)
898+
if field is not None:
899+
args["partitioning_schema"] = unmarshal_Schema(field)
900+
else:
901+
args["partitioning_schema"] = None
902+
897903
return ServerInstall(**args)
898904

899905

@@ -1362,6 +1368,136 @@ def marshal_AddOptionServerRequest(
13621368
return output
13631369

13641370

1371+
def marshal_SchemaPartition(
1372+
request: SchemaPartition,
1373+
defaults: ProfileDefaults,
1374+
) -> Dict[str, Any]:
1375+
output: Dict[str, Any] = {}
1376+
1377+
if request.label is not None:
1378+
output["label"] = str(request.label)
1379+
1380+
if request.number is not None:
1381+
output["number"] = request.number
1382+
1383+
if request.size is not None:
1384+
output["size"] = request.size
1385+
1386+
return output
1387+
1388+
1389+
def marshal_SchemaPool(
1390+
request: SchemaPool,
1391+
defaults: ProfileDefaults,
1392+
) -> Dict[str, Any]:
1393+
output: Dict[str, Any] = {}
1394+
1395+
if request.name is not None:
1396+
output["name"] = request.name
1397+
1398+
if request.type_ is not None:
1399+
output["type"] = str(request.type_)
1400+
1401+
if request.devices is not None:
1402+
output["devices"] = request.devices
1403+
1404+
if request.options is not None:
1405+
output["options"] = request.options
1406+
1407+
if request.filesystem_options is not None:
1408+
output["filesystem_options"] = request.filesystem_options
1409+
1410+
return output
1411+
1412+
1413+
def marshal_SchemaDisk(
1414+
request: SchemaDisk,
1415+
defaults: ProfileDefaults,
1416+
) -> Dict[str, Any]:
1417+
output: Dict[str, Any] = {}
1418+
1419+
if request.device is not None:
1420+
output["device"] = request.device
1421+
1422+
if request.partitions is not None:
1423+
output["partitions"] = [
1424+
marshal_SchemaPartition(item, defaults) for item in request.partitions
1425+
]
1426+
1427+
return output
1428+
1429+
1430+
def marshal_SchemaFilesystem(
1431+
request: SchemaFilesystem,
1432+
defaults: ProfileDefaults,
1433+
) -> Dict[str, Any]:
1434+
output: Dict[str, Any] = {}
1435+
1436+
if request.device is not None:
1437+
output["device"] = request.device
1438+
1439+
if request.format is not None:
1440+
output["format"] = str(request.format)
1441+
1442+
if request.mountpoint is not None:
1443+
output["mountpoint"] = request.mountpoint
1444+
1445+
return output
1446+
1447+
1448+
def marshal_SchemaRAID(
1449+
request: SchemaRAID,
1450+
defaults: ProfileDefaults,
1451+
) -> Dict[str, Any]:
1452+
output: Dict[str, Any] = {}
1453+
1454+
if request.name is not None:
1455+
output["name"] = request.name
1456+
1457+
if request.level is not None:
1458+
output["level"] = str(request.level)
1459+
1460+
if request.devices is not None:
1461+
output["devices"] = request.devices
1462+
1463+
return output
1464+
1465+
1466+
def marshal_SchemaZFS(
1467+
request: SchemaZFS,
1468+
defaults: ProfileDefaults,
1469+
) -> Dict[str, Any]:
1470+
output: Dict[str, Any] = {}
1471+
1472+
if request.pools is not None:
1473+
output["pools"] = [marshal_SchemaPool(item, defaults) for item in request.pools]
1474+
1475+
return output
1476+
1477+
1478+
def marshal_Schema(
1479+
request: Schema,
1480+
defaults: ProfileDefaults,
1481+
) -> Dict[str, Any]:
1482+
output: Dict[str, Any] = {}
1483+
1484+
if request.disks is not None:
1485+
output["disks"] = [marshal_SchemaDisk(item, defaults) for item in request.disks]
1486+
1487+
if request.raids is not None:
1488+
output["raids"] = [marshal_SchemaRAID(item, defaults) for item in request.raids]
1489+
1490+
if request.filesystems is not None:
1491+
output["filesystems"] = [
1492+
marshal_SchemaFilesystem(item, defaults) for item in request.filesystems
1493+
]
1494+
1495+
if request.zfs is not None:
1496+
output["zfs"] = marshal_SchemaZFS(request.zfs, defaults)
1497+
1498+
return output
1499+
1500+
13651501
def marshal_CreateServerRequestInstall(
13661502
request: CreateServerRequestInstall,
13671503
defaults: ProfileDefaults,
@@ -1389,6 +1525,11 @@ def marshal_CreateServerRequestInstall(
13891525
if request.service_password is not None:
13901526
output["service_password"] = request.service_password
13911527

1528+
if request.partitioning_schema is not None:
1529+
output["partitioning_schema"] = marshal_Schema(
1530+
request.partitioning_schema, defaults
1531+
)
1532+
13921533
return output
13931534

13941535

@@ -1462,6 +1603,11 @@ def marshal_InstallServerRequest(
14621603
if request.service_password is not None:
14631604
output["service_password"] = request.service_password
14641605

1606+
if request.partitioning_schema is not None:
1607+
output["partitioning_schema"] = marshal_Schema(
1608+
request.partitioning_schema, defaults
1609+
)
1610+
14651611
return output
14661612

14671613

@@ -1567,6 +1713,7 @@ def marshal_UpdateSettingRequest(
15671713
return output
15681714

15691715

1716+
15701717
def marshal_SchemaPartition(
15711718
request: SchemaPartition,
15721719
defaults: ProfileDefaults,
@@ -1697,6 +1844,7 @@ def marshal_Schema(
16971844
return output
16981845

16991846

1847+
17001848
def marshal_ValidatePartitioningSchemaRequest(
17011849
request: ValidatePartitioningSchemaRequest,
17021850
defaults: ProfileDefaults,

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,11 @@ class ServerInstall:
521521
Address of the installed service.
522522
"""
523523

524+
partitioning_schema: Optional[Schema]
525+
"""
526+
Partitioning schema.
527+
"""
528+
524529

525530
@dataclass
526531
class ServerOption:
@@ -610,6 +615,11 @@ class CreateServerRequestInstall:
610615
Password used for the service to install.
611616
"""
612617

618+
partitioning_schema: Optional[Schema]
619+
"""
620+
Partitioning schema.
621+
"""
622+
613623

614624
@dataclass
615625
class OS:
@@ -1282,6 +1292,11 @@ class InstallServerRequest:
12821292
Password used for the service to install.
12831293
"""
12841294

1295+
partitioning_schema: Optional[Schema]
1296+
"""
1297+
Partitioning schema.
1298+
"""
1299+
12851300

12861301
@dataclass
12871302
class ListOSRequest:

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@ class MemoryType(str, Enum, metaclass=StrEnumMeta):
362362
DDR2 = "ddr2"
363363
DDR3 = "ddr3"
364364
DDR4 = "ddr4"
365+
DDR5 = "ddr5"
365366

366367
def __str__(self) -> str:
367368
return str(self.value)

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -931,12 +931,11 @@ async def server_action(
931931
* `stop_in_place`: Stop the Instance, but keep the slot on the hypervisor.
932932
* `reboot`: Stop the instance and restart it.
933933
* `backup`: Create an image with all the volumes of an Instance.
934-
* `terminate`: Delete the Instance along with all attached volumes.
934+
* `terminate`: Delete the Instance along with its attached volumes, except for SBS volumes.
935935
* `enable_routed_ip`: Migrate the Instance to the new network stack.
936936
937-
Keep in mind that terminating an Instance will result in the deletion of all attached volumes, including local and block storage.
938-
If you want to preserve your local volumes, you should use the `archive` action instead of `terminate`. Similarly, if you want to keep your block storage volumes, you must first detach them before issuing the `terminate` command.
939-
For more information, read the [Volumes](#path-volumes-list-volumes) documentation.
937+
Keep in mind that `terminate` an Instance will result in the deletion of `l_ssd`, `b_ssd` and `scratch` volumes types, `sbs_volume` volumes type will only be detached.
938+
If you want to preserve your volumes, you should detach them before the Instance deletion or `terminate` action.
940939
:param server_id: UUID of the Instance.
941940
:param zone: Zone to target. If none is passed will use default zone from the config.
942941
:param action: Action to perform on the Instance.

0 commit comments

Comments
 (0)