Skip to content

Commit f9b9737

Browse files
authored
fix(instance/v1): revert "remove field export_uri on the Instance API" (scaleway#1455)
1 parent 47095da commit f9b9737

File tree

4 files changed

+70
-42
lines changed

4 files changed

+70
-42
lines changed

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

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -377,23 +377,11 @@ def unmarshal_Volume(data: Any) -> Volume:
377377
else:
378378
args["project"] = None
379379

380-
field = data.get("tags", None)
381-
if field is not None:
382-
args["tags"] = field
383-
else:
384-
args["tags"] = []
385-
386-
field = data.get("state", None)
387-
if field is not None:
388-
args["state"] = field
389-
else:
390-
args["state"] = VolumeState.AVAILABLE
391-
392-
field = data.get("zone", None)
380+
field = data.get("export_uri", None)
393381
if field is not None:
394-
args["zone"] = field
382+
args["export_uri"] = field
395383
else:
396-
args["zone"] = None
384+
args["export_uri"] = None
397385

398386
field = data.get("creation_date", None)
399387
if field is not None:
@@ -411,6 +399,24 @@ def unmarshal_Volume(data: Any) -> Volume:
411399
else:
412400
args["modification_date"] = None
413401

402+
field = data.get("tags", None)
403+
if field is not None:
404+
args["tags"] = field
405+
else:
406+
args["tags"] = []
407+
408+
field = data.get("state", None)
409+
if field is not None:
410+
args["state"] = field
411+
else:
412+
args["state"] = VolumeState.AVAILABLE
413+
414+
field = data.get("zone", None)
415+
if field is not None:
416+
args["zone"] = field
417+
else:
418+
args["zone"] = None
419+
414420
field = data.get("server", None)
415421
if field is not None:
416422
args["server"] = unmarshal_ServerSummary(field)
@@ -4024,6 +4030,15 @@ def marshal_Volume(
40244030
else:
40254031
output["project"] = defaults.default_project_id
40264032

4033+
if request.export_uri is not None:
4034+
output["export_uri"] = request.export_uri
4035+
4036+
if request.creation_date is not None:
4037+
output["creation_date"] = request.creation_date.isoformat()
4038+
4039+
if request.modification_date is not None:
4040+
output["modification_date"] = request.modification_date.isoformat()
4041+
40274042
if request.tags is not None:
40284043
output["tags"] = request.tags
40294044

@@ -4035,12 +4050,6 @@ def marshal_Volume(
40354050
else:
40364051
output["zone"] = defaults.default_zone
40374052

4038-
if request.creation_date is not None:
4039-
output["creation_date"] = request.creation_date.isoformat()
4040-
4041-
if request.modification_date is not None:
4042-
output["modification_date"] = request.modification_date.isoformat()
4043-
40444053
if request.server is not None:
40454054
output["server"] = marshal_ServerSummary(request.server, defaults)
40464055

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,11 @@ class Volume:
382382
Zone in which the volume is located.
383383
"""
384384

385+
export_uri: Optional[str] = None
386+
"""
387+
Show the volume NBD export URI (deprecated, will always be empty).
388+
"""
389+
385390
creation_date: Optional[datetime] = None
386391
"""
387392
Volume creation date.

scaleway/scaleway/instance/v1/marshalling.py

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -377,23 +377,11 @@ def unmarshal_Volume(data: Any) -> Volume:
377377
else:
378378
args["project"] = None
379379

380-
field = data.get("tags", None)
381-
if field is not None:
382-
args["tags"] = field
383-
else:
384-
args["tags"] = []
385-
386-
field = data.get("state", None)
387-
if field is not None:
388-
args["state"] = field
389-
else:
390-
args["state"] = VolumeState.AVAILABLE
391-
392-
field = data.get("zone", None)
380+
field = data.get("export_uri", None)
393381
if field is not None:
394-
args["zone"] = field
382+
args["export_uri"] = field
395383
else:
396-
args["zone"] = None
384+
args["export_uri"] = None
397385

398386
field = data.get("creation_date", None)
399387
if field is not None:
@@ -411,6 +399,24 @@ def unmarshal_Volume(data: Any) -> Volume:
411399
else:
412400
args["modification_date"] = None
413401

402+
field = data.get("tags", None)
403+
if field is not None:
404+
args["tags"] = field
405+
else:
406+
args["tags"] = []
407+
408+
field = data.get("state", None)
409+
if field is not None:
410+
args["state"] = field
411+
else:
412+
args["state"] = VolumeState.AVAILABLE
413+
414+
field = data.get("zone", None)
415+
if field is not None:
416+
args["zone"] = field
417+
else:
418+
args["zone"] = None
419+
414420
field = data.get("server", None)
415421
if field is not None:
416422
args["server"] = unmarshal_ServerSummary(field)
@@ -4024,6 +4030,15 @@ def marshal_Volume(
40244030
else:
40254031
output["project"] = defaults.default_project_id
40264032

4033+
if request.export_uri is not None:
4034+
output["export_uri"] = request.export_uri
4035+
4036+
if request.creation_date is not None:
4037+
output["creation_date"] = request.creation_date.isoformat()
4038+
4039+
if request.modification_date is not None:
4040+
output["modification_date"] = request.modification_date.isoformat()
4041+
40274042
if request.tags is not None:
40284043
output["tags"] = request.tags
40294044

@@ -4035,12 +4050,6 @@ def marshal_Volume(
40354050
else:
40364051
output["zone"] = defaults.default_zone
40374052

4038-
if request.creation_date is not None:
4039-
output["creation_date"] = request.creation_date.isoformat()
4040-
4041-
if request.modification_date is not None:
4042-
output["modification_date"] = request.modification_date.isoformat()
4043-
40444053
if request.server is not None:
40454054
output["server"] = marshal_ServerSummary(request.server, defaults)
40464055

scaleway/scaleway/instance/v1/types.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,11 @@ class Volume:
382382
Zone in which the volume is located.
383383
"""
384384

385+
export_uri: Optional[str] = None
386+
"""
387+
Show the volume NBD export URI (deprecated, will always be empty).
388+
"""
389+
385390
creation_date: Optional[datetime] = None
386391
"""
387392
Volume creation date.

0 commit comments

Comments
 (0)