Skip to content

Commit b3ba131

Browse files
scaleway-botyfodil
andauthored
feat(instance): add end_of_service flag in ServerList response (scaleway#945)
Co-authored-by: Yacine Fodil <[email protected]>
1 parent 6dece9c commit b3ba131

File tree

4 files changed

+90
-72
lines changed

4 files changed

+90
-72
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,10 @@ def unmarshal_Server(data: Any) -> Server:
898898
if field is not None:
899899
args["zone"] = field
900900

901+
field = data.get("end_of_service", None)
902+
if field is not None:
903+
args["end_of_service"] = field
904+
901905
field = data.get("admin_password_encryption_ssh_key_id", None)
902906
if field is not None:
903907
args["admin_password_encryption_ssh_key_id"] = field

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

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -832,94 +832,99 @@ class Server:
832832
Defines whether the Instance protection option is activated.
833833
"""
834834

835-
routed_ip_enabled: Optional[bool]
835+
public_ips: List[ServerIp]
836836
"""
837-
True to configure the instance so it uses the routed IP mode. Use of `routed_ip_enabled` as `False` is deprecated.
837+
Information about all the public IPs attached to the server.
838838
"""
839839

840-
enable_ipv6: Optional[bool]
840+
mac_address: str
841841
"""
842-
True if IPv6 is enabled (deprecated and always `False` when `routed_ip_enabled` is `True`).
842+
The server's MAC address.
843843
"""
844844

845-
image: Optional[Image]
845+
state: ServerState
846846
"""
847-
Information about the Instance image.
847+
Instance state.
848848
"""
849849

850-
private_ip: Optional[str]
850+
boot_type: BootType
851851
"""
852-
Private IP address of the Instance (deprecated and always `null` when `routed_ip_enabled` is `True`).
852+
Instance boot type.
853853
"""
854854

855-
public_ip: Optional[ServerIp]
855+
volumes: Dict[str, VolumeServer]
856856
"""
857-
Information about the public IP (deprecated in favor of `public_ips`).
857+
Instance volumes.
858858
"""
859859

860-
public_ips: List[ServerIp]
860+
maintenances: List[ServerMaintenance]
861861
"""
862-
Information about all the public IPs attached to the server.
862+
Instance planned maintenance.
863863
"""
864864

865-
mac_address: str
865+
state_detail: str
866866
"""
867-
The server's MAC address.
867+
Detailed information about the Instance state.
868868
"""
869869

870-
state: ServerState
870+
arch: Arch
871871
"""
872-
Instance state.
872+
Instance architecture.
873873
"""
874874

875-
boot_type: BootType
875+
private_nics: List[PrivateNIC]
876876
"""
877-
Instance boot type.
877+
Instance private NICs.
878878
"""
879879

880-
volumes: Dict[str, VolumeServer]
880+
zone: ScwZone
881881
"""
882-
Instance volumes.
882+
Zone in which the Instance is located.
883883
"""
884884

885-
modification_date: Optional[datetime]
885+
end_of_service: bool
886886
"""
887-
Instance modification date.
887+
True if the Instance type has reached end of service.
888888
"""
889889

890-
location: Optional[ServerLocation]
890+
routed_ip_enabled: Optional[bool]
891891
"""
892-
Instance location.
892+
True to configure the instance so it uses the routed IP mode. Use of `routed_ip_enabled` as `False` is deprecated.
893893
"""
894894

895-
ipv6: Optional[ServerIpv6]
895+
enable_ipv6: Optional[bool]
896896
"""
897-
Instance IPv6 address (deprecated when `routed_ip_enabled` is `True`).
897+
True if IPv6 is enabled (deprecated and always `False` when `routed_ip_enabled` is `True`).
898898
"""
899899

900-
maintenances: List[ServerMaintenance]
900+
image: Optional[Image]
901901
"""
902-
Instance planned maintenance.
902+
Information about the Instance image.
903903
"""
904904

905-
state_detail: str
905+
private_ip: Optional[str]
906906
"""
907-
Detailed information about the Instance state.
907+
Private IP address of the Instance (deprecated and always `null` when `routed_ip_enabled` is `True`).
908908
"""
909909

910-
arch: Arch
910+
public_ip: Optional[ServerIp]
911911
"""
912-
Instance architecture.
912+
Information about the public IP (deprecated in favor of `public_ips`).
913913
"""
914914

915-
private_nics: List[PrivateNIC]
915+
modification_date: Optional[datetime]
916916
"""
917-
Instance private NICs.
917+
Instance modification date.
918918
"""
919919

920-
zone: ScwZone
920+
location: Optional[ServerLocation]
921921
"""
922-
Zone in which the Instance is located.
922+
Instance location.
923+
"""
924+
925+
ipv6: Optional[ServerIpv6]
926+
"""
927+
Instance IPv6 address (deprecated when `routed_ip_enabled` is `True`).
923928
"""
924929

925930
security_group: Optional[SecurityGroupSummary]

scaleway/scaleway/instance/v1/marshalling.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,10 @@ def unmarshal_Server(data: Any) -> Server:
898898
if field is not None:
899899
args["zone"] = field
900900

901+
field = data.get("end_of_service", None)
902+
if field is not None:
903+
args["end_of_service"] = field
904+
901905
field = data.get("admin_password_encryption_ssh_key_id", None)
902906
if field is not None:
903907
args["admin_password_encryption_ssh_key_id"] = field

scaleway/scaleway/instance/v1/types.py

Lines changed: 41 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -832,94 +832,99 @@ class Server:
832832
Defines whether the Instance protection option is activated.
833833
"""
834834

835-
routed_ip_enabled: Optional[bool]
835+
public_ips: List[ServerIp]
836836
"""
837-
True to configure the instance so it uses the routed IP mode. Use of `routed_ip_enabled` as `False` is deprecated.
837+
Information about all the public IPs attached to the server.
838838
"""
839839

840-
enable_ipv6: Optional[bool]
840+
mac_address: str
841841
"""
842-
True if IPv6 is enabled (deprecated and always `False` when `routed_ip_enabled` is `True`).
842+
The server's MAC address.
843843
"""
844844

845-
image: Optional[Image]
845+
state: ServerState
846846
"""
847-
Information about the Instance image.
847+
Instance state.
848848
"""
849849

850-
private_ip: Optional[str]
850+
boot_type: BootType
851851
"""
852-
Private IP address of the Instance (deprecated and always `null` when `routed_ip_enabled` is `True`).
852+
Instance boot type.
853853
"""
854854

855-
public_ip: Optional[ServerIp]
855+
volumes: Dict[str, VolumeServer]
856856
"""
857-
Information about the public IP (deprecated in favor of `public_ips`).
857+
Instance volumes.
858858
"""
859859

860-
public_ips: List[ServerIp]
860+
maintenances: List[ServerMaintenance]
861861
"""
862-
Information about all the public IPs attached to the server.
862+
Instance planned maintenance.
863863
"""
864864

865-
mac_address: str
865+
state_detail: str
866866
"""
867-
The server's MAC address.
867+
Detailed information about the Instance state.
868868
"""
869869

870-
state: ServerState
870+
arch: Arch
871871
"""
872-
Instance state.
872+
Instance architecture.
873873
"""
874874

875-
boot_type: BootType
875+
private_nics: List[PrivateNIC]
876876
"""
877-
Instance boot type.
877+
Instance private NICs.
878878
"""
879879

880-
volumes: Dict[str, VolumeServer]
880+
zone: ScwZone
881881
"""
882-
Instance volumes.
882+
Zone in which the Instance is located.
883883
"""
884884

885-
modification_date: Optional[datetime]
885+
end_of_service: bool
886886
"""
887-
Instance modification date.
887+
True if the Instance type has reached end of service.
888888
"""
889889

890-
location: Optional[ServerLocation]
890+
routed_ip_enabled: Optional[bool]
891891
"""
892-
Instance location.
892+
True to configure the instance so it uses the routed IP mode. Use of `routed_ip_enabled` as `False` is deprecated.
893893
"""
894894

895-
ipv6: Optional[ServerIpv6]
895+
enable_ipv6: Optional[bool]
896896
"""
897-
Instance IPv6 address (deprecated when `routed_ip_enabled` is `True`).
897+
True if IPv6 is enabled (deprecated and always `False` when `routed_ip_enabled` is `True`).
898898
"""
899899

900-
maintenances: List[ServerMaintenance]
900+
image: Optional[Image]
901901
"""
902-
Instance planned maintenance.
902+
Information about the Instance image.
903903
"""
904904

905-
state_detail: str
905+
private_ip: Optional[str]
906906
"""
907-
Detailed information about the Instance state.
907+
Private IP address of the Instance (deprecated and always `null` when `routed_ip_enabled` is `True`).
908908
"""
909909

910-
arch: Arch
910+
public_ip: Optional[ServerIp]
911911
"""
912-
Instance architecture.
912+
Information about the public IP (deprecated in favor of `public_ips`).
913913
"""
914914

915-
private_nics: List[PrivateNIC]
915+
modification_date: Optional[datetime]
916916
"""
917-
Instance private NICs.
917+
Instance modification date.
918918
"""
919919

920-
zone: ScwZone
920+
location: Optional[ServerLocation]
921921
"""
922-
Zone in which the Instance is located.
922+
Instance location.
923+
"""
924+
925+
ipv6: Optional[ServerIpv6]
926+
"""
927+
Instance IPv6 address (deprecated when `routed_ip_enabled` is `True`).
923928
"""
924929

925930
security_group: Optional[SecurityGroupSummary]

0 commit comments

Comments
 (0)