Skip to content

Commit 9eb37ad

Browse files
feat(baremetal): expose zone for offers and os (#1308)
Co-authored-by: Jonathan R. <jremy@scaleway.com>
1 parent 38fae67 commit 9eb37ad

File tree

6 files changed

+52
-6
lines changed

6 files changed

+52
-6
lines changed

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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,12 @@ def unmarshal_OS(data: Any) -> OS:
824824
else:
825825
args["custom_partitioning_supported"] = False
826826

827+
field = data.get("zone", None)
828+
if field is not None:
829+
args["zone"] = field
830+
else:
831+
args["zone"] = None
832+
827833
return OS(**args)
828834

829835

@@ -1214,6 +1220,12 @@ def unmarshal_Offer(data: Any) -> Offer:
12141220
else:
12151221
args["operation_path"] = None
12161222

1223+
field = data.get("fee", None)
1224+
if field is not None:
1225+
args["fee"] = unmarshal_Money(field)
1226+
else:
1227+
args["fee"] = None
1228+
12171229
field = data.get("options", None)
12181230
if field is not None:
12191231
args["options"] = (
@@ -1248,11 +1260,11 @@ def unmarshal_Offer(data: Any) -> Offer:
12481260
else:
12491261
args["gpus"] = []
12501262

1251-
field = data.get("fee", None)
1263+
field = data.get("zone", None)
12521264
if field is not None:
1253-
args["fee"] = unmarshal_Money(field)
1265+
args["zone"] = field
12541266
else:
1255-
args["fee"] = None
1267+
args["zone"] = None
12561268

12571269
field = data.get("monthly_offer_id", None)
12581270
if field is not None:

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,11 @@ class OS:
811811
Defines if custom partitioning is supported by this OS.
812812
"""
813813

814+
zone: ScwZone
815+
"""
816+
Zone in which is the OS is available.
817+
"""
818+
814819
ssh: Optional[OSOSField] = None
815820
"""
816821
Object defining the SSH requirements to install the OS.
@@ -944,6 +949,11 @@ class Offer:
944949
GPU specifications of the offer.
945950
"""
946951

952+
zone: ScwZone
953+
"""
954+
Zone in which is the offer is available.
955+
"""
956+
947957
price_per_hour: Optional[Money] = None
948958
"""
949959
Price of the offer for the next 60 minutes (a server order at 11h32 will be paid until 12h32).

scaleway-async/scaleway_async/product_catalog/v2alpha1/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ class PublicCatalogProductUnitOfMeasureCountableUnit(str, Enum, metaclass=StrEnu
8484
SECOND = "second"
8585
SAMPLE_DAY = "sample_day"
8686
GIGABYTE_DAY = "gigabyte_day"
87+
MVCPU = "mvcpu"
8788

8889
def __str__(self) -> str:
8990
return str(self.value)

scaleway/scaleway/baremetal/v1/marshalling.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,12 @@ def unmarshal_OS(data: Any) -> OS:
824824
else:
825825
args["custom_partitioning_supported"] = False
826826

827+
field = data.get("zone", None)
828+
if field is not None:
829+
args["zone"] = field
830+
else:
831+
args["zone"] = None
832+
827833
return OS(**args)
828834

829835

@@ -1214,6 +1220,12 @@ def unmarshal_Offer(data: Any) -> Offer:
12141220
else:
12151221
args["operation_path"] = None
12161222

1223+
field = data.get("fee", None)
1224+
if field is not None:
1225+
args["fee"] = unmarshal_Money(field)
1226+
else:
1227+
args["fee"] = None
1228+
12171229
field = data.get("options", None)
12181230
if field is not None:
12191231
args["options"] = (
@@ -1248,11 +1260,11 @@ def unmarshal_Offer(data: Any) -> Offer:
12481260
else:
12491261
args["gpus"] = []
12501262

1251-
field = data.get("fee", None)
1263+
field = data.get("zone", None)
12521264
if field is not None:
1253-
args["fee"] = unmarshal_Money(field)
1265+
args["zone"] = field
12541266
else:
1255-
args["fee"] = None
1267+
args["zone"] = None
12561268

12571269
field = data.get("monthly_offer_id", None)
12581270
if field is not None:

scaleway/scaleway/baremetal/v1/types.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,11 @@ class OS:
811811
Defines if custom partitioning is supported by this OS.
812812
"""
813813

814+
zone: ScwZone
815+
"""
816+
Zone in which is the OS is available.
817+
"""
818+
814819
ssh: Optional[OSOSField] = None
815820
"""
816821
Object defining the SSH requirements to install the OS.
@@ -944,6 +949,11 @@ class Offer:
944949
GPU specifications of the offer.
945950
"""
946951

952+
zone: ScwZone
953+
"""
954+
Zone in which is the offer is available.
955+
"""
956+
947957
price_per_hour: Optional[Money] = None
948958
"""
949959
Price of the offer for the next 60 minutes (a server order at 11h32 will be paid until 12h32).

scaleway/scaleway/product_catalog/v2alpha1/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ class PublicCatalogProductUnitOfMeasureCountableUnit(str, Enum, metaclass=StrEnu
8484
SECOND = "second"
8585
SAMPLE_DAY = "sample_day"
8686
GIGABYTE_DAY = "gigabyte_day"
87+
MVCPU = "mvcpu"
8788

8889
def __str__(self) -> str:
8990
return str(self.value)

0 commit comments

Comments
 (0)