Skip to content

Commit 9c2a08a

Browse files
authored
docs(instance): mark some fields as deprecated following ipmob introduction (#494)
1 parent e7ca777 commit 9c2a08a

File tree

8 files changed

+110
-92
lines changed

8 files changed

+110
-92
lines changed

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

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ async def list_servers(
366366
name: Optional[str] = None,
367367
private_ip: Optional[str] = None,
368368
without_ip: Optional[bool] = None,
369+
with_ip: Optional[str] = None,
369370
commercial_type: Optional[str] = None,
370371
state: Optional[ServerState] = None,
371372
tags: Optional[List[str]] = None,
@@ -386,6 +387,7 @@ async def list_servers(
386387
:param name: Filter Instances by name (eg. "server1" will return "server100" and "server1" but not "foo").
387388
:param private_ip: List Instances by private_ip.
388389
:param without_ip: List Instances that are not attached to a public IP.
390+
:param with_ip: List Instances by IP (both private_ip and public_ip are supported).
389391
:param commercial_type: List Instances of this commercial type.
390392
:param state: List Instances in this state.
391393
:param tags: List Instances with these exact tags (to filter with several tags, use commas to separate them).
@@ -424,6 +426,7 @@ async def list_servers(
424426
"servers": ",".join(servers) if servers and len(servers) > 0 else None,
425427
"state": state,
426428
"tags": ",".join(tags) if tags and len(tags) > 0 else None,
429+
"with_ip": with_ip,
427430
"without_ip": without_ip,
428431
},
429432
)
@@ -442,6 +445,7 @@ async def list_servers_all(
442445
name: Optional[str] = None,
443446
private_ip: Optional[str] = None,
444447
without_ip: Optional[bool] = None,
448+
with_ip: Optional[str] = None,
445449
commercial_type: Optional[str] = None,
446450
state: Optional[ServerState] = None,
447451
tags: Optional[List[str]] = None,
@@ -462,6 +466,7 @@ async def list_servers_all(
462466
:param name: Filter Instances by name (eg. "server1" will return "server100" and "server1" but not "foo").
463467
:param private_ip: List Instances by private_ip.
464468
:param without_ip: List Instances that are not attached to a public IP.
469+
:param with_ip: List Instances by IP (both private_ip and public_ip are supported).
465470
:param commercial_type: List Instances of this commercial type.
466471
:param state: List Instances in this state.
467472
:param tags: List Instances with these exact tags (to filter with several tags, use commas to separate them).
@@ -491,6 +496,7 @@ async def list_servers_all(
491496
"name": name,
492497
"private_ip": private_ip,
493498
"without_ip": without_ip,
499+
"with_ip": with_ip,
494500
"commercial_type": commercial_type,
495501
"state": state,
496502
"tags": tags,
@@ -507,12 +513,12 @@ async def _create_server(
507513
*,
508514
commercial_type: str,
509515
image: str,
510-
enable_ipv6: bool,
511516
zone: Optional[Zone] = None,
512517
name: Optional[str] = None,
513518
dynamic_ip_required: Optional[bool] = None,
514519
routed_ip_enabled: Optional[bool] = None,
515520
volumes: Optional[Dict[str, VolumeServerTemplate]] = None,
521+
enable_ipv6: Optional[bool] = None,
516522
public_ip: Optional[str] = None,
517523
public_ips: Optional[List[str]] = None,
518524
boot_type: Optional[BootType] = None,
@@ -529,12 +535,12 @@ async def _create_server(
529535
Get more information in the [Technical Information](#technical-information) section of the introduction.
530536
:param commercial_type: Define the Instance commercial type (i.e. GP1-S).
531537
:param image: Instance image ID or label.
532-
:param enable_ipv6: True if IPv6 is enabled on the server.
533538
:param zone: Zone to target. If none is passed will use default zone from the config.
534539
:param name: Instance name.
535540
:param dynamic_ip_required: Define if a dynamic IPv4 is required for the Instance.
536541
:param routed_ip_enabled: If true, configure the Instance so it uses the new routed IP mode.
537542
:param volumes: Volumes attached to the server.
543+
:param enable_ipv6: True if IPv6 is enabled on the server (deprecated and always `False` when `routed_ip_enabled` is `True`).
538544
:param public_ip: ID of the reserved IP to attach to the Instance.
539545
:param public_ips: A list of reserved IP IDs to attach to the Instance.
540546
:param boot_type: Boot type to use.
@@ -554,7 +560,6 @@ async def _create_server(
554560
result = await api._create_server(
555561
commercial_type="example",
556562
image="example",
557-
enable_ipv6=False,
558563
)
559564
"""
560565

@@ -565,14 +570,14 @@ async def _create_server(
565570
f"/instance/v1/zones/{param_zone}/servers",
566571
body=marshal_CreateServerRequest(
567572
CreateServerRequest(
568-
zone=zone,
569573
commercial_type=commercial_type,
570574
image=image,
575+
zone=zone,
571576
name=name or random_name(prefix="srv"),
572577
dynamic_ip_required=dynamic_ip_required,
573578
routed_ip_enabled=routed_ip_enabled,
574-
enable_ipv6=enable_ipv6,
575579
volumes=volumes,
580+
enable_ipv6=enable_ipv6,
576581
public_ip=public_ip,
577582
public_ips=public_ips,
578583
boot_type=boot_type,
@@ -660,14 +665,14 @@ async def _set_server(
660665
name: str,
661666
commercial_type: str,
662667
dynamic_ip_required: bool,
663-
enable_ipv6: bool,
664668
hostname: str,
665669
organization: Optional[str] = None,
666670
project: Optional[str] = None,
667671
allowed_actions: Optional[List[ServerAction]] = None,
668672
tags: Optional[List[str]] = None,
669673
creation_date: Optional[datetime] = None,
670674
routed_ip_enabled: Optional[bool] = None,
675+
enable_ipv6: Optional[bool] = None,
671676
image: Optional[Image] = None,
672677
protected: bool,
673678
private_ip: Optional[str] = None,
@@ -693,24 +698,24 @@ async def _set_server(
693698
:param name: Instance name.
694699
:param commercial_type: Instance commercial type (eg. GP1-M).
695700
:param dynamic_ip_required: True if a dynamic IPv4 is required.
696-
:param enable_ipv6: True if IPv6 is enabled.
697701
:param hostname: Instance host name.
698702
:param organization: Instance Organization ID.
699703
:param project: Instance Project ID.
700704
:param allowed_actions: Provide a list of allowed actions on the server.
701705
:param tags: Tags associated with the Instance.
702706
:param creation_date: Instance creation date.
703707
:param routed_ip_enabled: True to configure the instance so it uses the new routed IP mode (once this is set to True you cannot set it back to False).
708+
:param enable_ipv6: True if IPv6 is enabled (deprecated and always `False` when `routed_ip_enabled` is `True`).
704709
:param image: Provide information on the Instance image.
705710
:param protected: Instance protection option is activated.
706-
:param private_ip: Instance private IP address.
707-
:param public_ip: Information about the public IP.
711+
:param private_ip: Instance private IP address (deprecated and always `null` when `routed_ip_enabled` is `True`).
712+
:param public_ip: Information about the public IP (deprecated in favor of `public_ips`).
708713
:param public_ips: Information about all the public IPs attached to the server.
709714
:param modification_date: Instance modification date.
710715
:param state_detail: Instance state_detail.
711716
:param state: Instance state.
712717
:param location: Instance location.
713-
:param ipv6: Instance IPv6 address.
718+
:param ipv6: Instance IPv6 address (deprecated when `routed_ip_enabled` is `True`).
714719
:param bootscript: Instance bootscript.
715720
:param boot_type: Instance boot type.
716721
:param volumes: Instance volumes.
@@ -729,7 +734,6 @@ async def _set_server(
729734
name="example",
730735
commercial_type="example",
731736
dynamic_ip_required=False,
732-
enable_ipv6=False,
733737
hostname="example",
734738
protected=False,
735739
state_detail="example",
@@ -749,14 +753,14 @@ async def _set_server(
749753
name=name,
750754
commercial_type=commercial_type,
751755
dynamic_ip_required=dynamic_ip_required,
752-
enable_ipv6=enable_ipv6,
753756
hostname=hostname,
754757
organization=organization,
755758
project=project,
756759
allowed_actions=allowed_actions,
757760
tags=tags,
758761
creation_date=creation_date,
759762
routed_ip_enabled=routed_ip_enabled,
763+
enable_ipv6=enable_ipv6,
760764
image=image,
761765
protected=protected,
762766
private_ip=private_ip,

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -741,10 +741,6 @@ def unmarshal_Server(data: Any) -> Server:
741741
if field is not None:
742742
args["routed_ip_enabled"] = field
743743

744-
field = data.get("enable_ipv6", None)
745-
if field is not None:
746-
args["enable_ipv6"] = field
747-
748744
field = data.get("hostname", None)
749745
if field is not None:
750746
args["hostname"] = field
@@ -753,6 +749,10 @@ def unmarshal_Server(data: Any) -> Server:
753749
if field is not None:
754750
args["protected"] = field
755751

752+
field = data.get("enable_ipv6", None)
753+
if field is not None:
754+
args["enable_ipv6"] = field
755+
756756
field = data.get("image", None)
757757
if field is not None:
758758
args["image"] = unmarshal_Image(field)
@@ -2877,15 +2877,15 @@ def marshal_CreateServerRequest(
28772877
if request.routed_ip_enabled is not None:
28782878
output["routed_ip_enabled"] = request.routed_ip_enabled
28792879

2880-
if request.enable_ipv6 is not None:
2881-
output["enable_ipv6"] = request.enable_ipv6
2882-
28832880
if request.volumes is not None:
28842881
output["volumes"] = {
28852882
key: marshal_VolumeServerTemplate(value, defaults)
28862883
for key, value in request.volumes.items()
28872884
}
28882885

2886+
if request.enable_ipv6 is not None:
2887+
output["enable_ipv6"] = request.enable_ipv6
2888+
28892889
if request.public_ip is not None:
28902890
output["public_ip"] = request.public_ip
28912891

@@ -3972,9 +3972,6 @@ def marshal__SetServerRequest(
39723972
if request.dynamic_ip_required is not None:
39733973
output["dynamic_ip_required"] = request.dynamic_ip_required
39743974

3975-
if request.enable_ipv6 is not None:
3976-
output["enable_ipv6"] = request.enable_ipv6
3977-
39783975
if request.hostname is not None:
39793976
output["hostname"] = request.hostname
39803977

@@ -3998,6 +3995,9 @@ def marshal__SetServerRequest(
39983995
if request.routed_ip_enabled is not None:
39993996
output["routed_ip_enabled"] = request.routed_ip_enabled
40003997

3998+
if request.enable_ipv6 is not None:
3999+
output["enable_ipv6"] = request.enable_ipv6
4000+
40014001
if request.image is not None:
40024002
output["image"] = (marshal_Image(request.image, defaults),)
40034003

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

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -842,11 +842,6 @@ class Server:
842842
True to configure the instance so it uses the new routed IP mode.
843843
"""
844844

845-
enable_ipv6: bool
846-
"""
847-
True if IPv6 is enabled.
848-
"""
849-
850845
hostname: str
851846
"""
852847
Instance host name.
@@ -857,19 +852,24 @@ class Server:
857852
Defines whether the Instance protection option is activated.
858853
"""
859854

855+
enable_ipv6: Optional[bool]
856+
"""
857+
True if IPv6 is enabled (deprecated and always `False` when `routed_ip_enabled` is `True`).
858+
"""
859+
860860
image: Optional[Image]
861861
"""
862862
Information about the Instance image.
863863
"""
864864

865865
private_ip: Optional[str]
866866
"""
867-
Private IP address of the Instance.
867+
Private IP address of the Instance (deprecated and always `null` when `routed_ip_enabled` is `True`).
868868
"""
869869

870870
public_ip: Optional[ServerIp]
871871
"""
872-
Information about the public IP.
872+
Information about the public IP (deprecated in favor of `public_ips`).
873873
"""
874874

875875
public_ips: List[ServerIp]
@@ -909,7 +909,7 @@ class Server:
909909

910910
ipv6: Optional[ServerIpv6]
911911
"""
912-
Instance IPv6 address.
912+
Instance IPv6 address (deprecated when `routed_ip_enabled` is `True`).
913913
"""
914914

915915
bootscript: Optional[Bootscript]
@@ -1783,11 +1783,6 @@ class CreateSecurityGroupRuleResponse:
17831783

17841784
@dataclass
17851785
class CreateServerRequest:
1786-
zone: Optional[Zone]
1787-
"""
1788-
Zone to target. If none is passed will use default zone from the config.
1789-
"""
1790-
17911786
commercial_type: str
17921787
"""
17931788
Define the Instance commercial type (i.e. GP1-S).
@@ -1798,6 +1793,11 @@ class CreateServerRequest:
17981793
Instance image ID or label.
17991794
"""
18001795

1796+
zone: Optional[Zone]
1797+
"""
1798+
Zone to target. If none is passed will use default zone from the config.
1799+
"""
1800+
18011801
name: Optional[str]
18021802
"""
18031803
Instance name.
@@ -1813,14 +1813,14 @@ class CreateServerRequest:
18131813
If true, configure the Instance so it uses the new routed IP mode.
18141814
"""
18151815

1816-
enable_ipv6: bool
1816+
volumes: Optional[Dict[str, VolumeServerTemplate]]
18171817
"""
1818-
True if IPv6 is enabled on the server.
1818+
Volumes attached to the server.
18191819
"""
18201820

1821-
volumes: Optional[Dict[str, VolumeServerTemplate]]
1821+
enable_ipv6: Optional[bool]
18221822
"""
1823-
Volumes attached to the server.
1823+
True if IPv6 is enabled on the server (deprecated and always `False` when `routed_ip_enabled` is `True`).
18241824
"""
18251825

18261826
public_ip: Optional[str]
@@ -2774,6 +2774,11 @@ class ListServersRequest:
27742774
List Instances that are not attached to a public IP.
27752775
"""
27762776

2777+
with_ip: Optional[str]
2778+
"""
2779+
List Instances by IP (both private_ip and public_ip are supported).
2780+
"""
2781+
27772782
commercial_type: Optional[str]
27782783
"""
27792784
List Instances of this commercial type.

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,6 @@ class _SetServerRequest:
164164
"""
165165
True if a dynamic IPv4 is required.
166166
"""
167-
enable_ipv6: bool
168-
"""
169-
True if IPv6 is enabled.
170-
"""
171167
hostname: str
172168
"""
173169
Instance host name.
@@ -196,6 +192,10 @@ class _SetServerRequest:
196192
"""
197193
True to configure the instance so it uses the new routed IP mode (once this is set to True you cannot set it back to False).
198194
"""
195+
enable_ipv6: Optional[bool]
196+
"""
197+
True if IPv6 is enabled (deprecated and always `False` when `routed_ip_enabled` is `True`).
198+
"""
199199
image: Optional[Image]
200200
"""
201201
Provide information on the Instance image.
@@ -206,11 +206,11 @@ class _SetServerRequest:
206206
"""
207207
private_ip: Optional[str]
208208
"""
209-
Instance private IP address.
209+
Instance private IP address (deprecated and always `null` when `routed_ip_enabled` is `True`).
210210
"""
211211
public_ip: Optional[ServerIp]
212212
"""
213-
Information about the public IP.
213+
Information about the public IP (deprecated in favor of `public_ips`).
214214
"""
215215
public_ips: Optional[List[ServerIp]]
216216
"""
@@ -234,7 +234,7 @@ class _SetServerRequest:
234234
"""
235235
ipv6: Optional[ServerIpv6]
236236
"""
237-
Instance IPv6 address.
237+
Instance IPv6 address (deprecated when `routed_ip_enabled` is `True`).
238238
"""
239239
bootscript: Optional[Bootscript]
240240
"""

0 commit comments

Comments
 (0)