Skip to content

Commit d6ab2af

Browse files
fix(instance): remove deprecated bootscript documentation (#693)
Co-authored-by: Laure-di <[email protected]>
1 parent 180462b commit d6ab2af

File tree

10 files changed

+88
-706
lines changed

10 files changed

+88
-706
lines changed

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@
111111
from .types import DetachServerVolumeResponse
112112
from .types import ExportSnapshotRequest
113113
from .types import ExportSnapshotResponse
114-
from .types import GetBootscriptRequest
115-
from .types import GetBootscriptResponse
116114
from .types import GetDashboardRequest
117115
from .types import GetDashboardResponse
118116
from .types import GetImageRequest
@@ -137,8 +135,6 @@
137135
from .types import GetSnapshotResponse
138136
from .types import GetVolumeRequest
139137
from .types import GetVolumeResponse
140-
from .types import ListBootscriptsRequest
141-
from .types import ListBootscriptsResponse
142138
from .types import ListDefaultSecurityGroupRulesRequest
143139
from .types import ListImagesRequest
144140
from .types import ListImagesResponse
@@ -310,8 +306,6 @@
310306
"DetachServerVolumeResponse",
311307
"ExportSnapshotRequest",
312308
"ExportSnapshotResponse",
313-
"GetBootscriptRequest",
314-
"GetBootscriptResponse",
315309
"GetDashboardRequest",
316310
"GetDashboardResponse",
317311
"GetImageRequest",
@@ -336,8 +330,6 @@
336330
"GetSnapshotResponse",
337331
"GetVolumeRequest",
338332
"GetVolumeResponse",
339-
"ListBootscriptsRequest",
340-
"ListBootscriptsResponse",
341333
"ListDefaultSecurityGroupRulesRequest",
342334
"ListImagesRequest",
343335
"ListImagesResponse",

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

Lines changed: 6 additions & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@
6868
DetachServerVolumeResponse,
6969
ExportSnapshotRequest,
7070
ExportSnapshotResponse,
71-
GetBootscriptResponse,
7271
GetDashboardResponse,
7372
GetImageResponse,
7473
GetIpResponse,
@@ -83,7 +82,6 @@
8382
GetVolumeResponse,
8483
Image,
8584
Ip,
86-
ListBootscriptsResponse,
8785
ListImagesResponse,
8886
ListIpsResponse,
8987
ListPlacementGroupsResponse,
@@ -163,7 +161,6 @@
163161
unmarshal_CreateVolumeResponse,
164162
unmarshal_DetachServerVolumeResponse,
165163
unmarshal_ExportSnapshotResponse,
166-
unmarshal_GetBootscriptResponse,
167164
unmarshal_GetDashboardResponse,
168165
unmarshal_GetImageResponse,
169166
unmarshal_GetIpResponse,
@@ -176,7 +173,6 @@
176173
unmarshal_GetServerTypesAvailabilityResponse,
177174
unmarshal_GetSnapshotResponse,
178175
unmarshal_GetVolumeResponse,
179-
unmarshal_ListBootscriptsResponse,
180176
unmarshal_ListImagesResponse,
181177
unmarshal_ListIpsResponse,
182178
unmarshal_ListPlacementGroupsResponse,
@@ -522,7 +518,6 @@ async def _create_server(
522518
public_ip: Optional[str] = None,
523519
public_ips: Optional[List[str]] = None,
524520
boot_type: Optional[BootType] = None,
525-
bootscript: Optional[str] = None,
526521
organization: Optional[str] = None,
527522
project: Optional[str] = None,
528523
tags: Optional[List[str]] = None,
@@ -545,7 +540,6 @@ async def _create_server(
545540
:param public_ip: ID of the reserved IP to attach to the Instance.
546541
:param public_ips: A list of reserved IP IDs to attach to the Instance.
547542
:param boot_type: Boot type to use.
548-
:param bootscript: Bootscript ID to use when `boot_type` is set to `bootscript`.
549543
:param organization: Instance Organization ID.
550544
One-Of ('project_identifier'): at most one of 'project', 'organization' could be set.
551545
:param project: Instance Project ID.
@@ -583,7 +577,6 @@ async def _create_server(
583577
public_ip=public_ip,
584578
public_ips=public_ips,
585579
boot_type=boot_type,
586-
bootscript=bootscript,
587580
tags=tags,
588581
security_group=security_group,
589582
placement_group=placement_group,
@@ -667,27 +660,26 @@ async def _set_server(
667660
id: str,
668661
name: str,
669662
commercial_type: str,
670-
organization: Optional[str] = None,
671663
dynamic_ip_required: bool,
672664
hostname: str,
673-
protected: bool,
674-
state_detail: str,
665+
organization: Optional[str] = None,
675666
project: Optional[str] = None,
676667
allowed_actions: Optional[List[ServerAction]] = None,
677668
tags: Optional[List[str]] = None,
678669
creation_date: Optional[datetime] = None,
679670
routed_ip_enabled: Optional[bool] = None,
680671
enable_ipv6: Optional[bool] = None,
681672
image: Optional[Image] = None,
673+
protected: bool,
682674
private_ip: Optional[str] = None,
683675
public_ip: Optional[ServerIp] = None,
684676
public_ips: Optional[List[ServerIp]] = None,
685677
modification_date: Optional[datetime] = None,
686678
state: Optional[ServerState] = None,
687679
location: Optional[ServerLocation] = None,
688680
ipv6: Optional[ServerIpv6] = None,
689-
bootscript: Optional[Bootscript] = None,
690681
boot_type: Optional[BootType] = None,
682+
state_detail: str,
691683
volumes: Optional[Dict[str, Volume]] = None,
692684
security_group: Optional[SecurityGroupSummary] = None,
693685
maintenances: Optional[List[ServerMaintenance]] = None,
@@ -701,27 +693,26 @@ async def _set_server(
701693
:param id: Instance unique ID.
702694
:param name: Instance name.
703695
:param commercial_type: Instance commercial type (eg. GP1-M).
704-
:param organization: Instance Organization ID.
705696
:param dynamic_ip_required: True if a dynamic IPv4 is required.
706697
:param hostname: Instance host name.
707-
:param protected: Instance protection option is activated.
708-
:param state_detail: Instance state_detail.
698+
:param organization: Instance Organization ID.
709699
:param project: Instance Project ID.
710700
:param allowed_actions: Provide a list of allowed actions on the server.
711701
:param tags: Tags associated with the Instance.
712702
:param creation_date: Instance creation date.
713703
: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).
714704
:param enable_ipv6: True if IPv6 is enabled (deprecated and always `False` when `routed_ip_enabled` is `True`).
715705
:param image: Provide information on the Instance image.
706+
:param protected: Instance protection option is activated.
716707
:param private_ip: Instance private IP address (deprecated and always `null` when `routed_ip_enabled` is `True`).
717708
:param public_ip: Information about the public IP (deprecated in favor of `public_ips`).
718709
:param public_ips: Information about all the public IPs attached to the server.
719710
:param modification_date: Instance modification date.
720711
:param state: Instance state.
721712
:param location: Instance location.
722713
:param ipv6: Instance IPv6 address (deprecated when `routed_ip_enabled` is `True`).
723-
:param bootscript: Instance bootscript.
724714
:param boot_type: Instance boot type.
715+
:param state_detail: Instance state_detail.
725716
:param volumes: Instance volumes.
726717
:param security_group: Instance security group.
727718
:param maintenances: Instance planned maintenances.
@@ -776,7 +767,6 @@ async def _set_server(
776767
state=state,
777768
location=location,
778769
ipv6=ipv6,
779-
bootscript=bootscript,
780770
boot_type=boot_type,
781771
volumes=volumes,
782772
security_group=security_group,
@@ -802,7 +792,6 @@ async def _update_server(
802792
boot_type: Optional[BootType] = None,
803793
tags: Optional[List[str]] = None,
804794
volumes: Optional[Dict[str, VolumeServerTemplate]] = None,
805-
bootscript: Optional[str] = None,
806795
dynamic_ip_required: Optional[bool] = None,
807796
routed_ip_enabled: Optional[bool] = None,
808797
public_ips: Optional[List[str]] = None,
@@ -823,7 +812,6 @@ async def _update_server(
823812
:param boot_type:
824813
:param tags: Tags of the Instance.
825814
:param volumes:
826-
:param bootscript:
827815
:param dynamic_ip_required:
828816
: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).
829817
:param public_ips: A list of reserved IP IDs to attach to the Instance.
@@ -862,7 +850,6 @@ async def _update_server(
862850
boot_type=boot_type,
863851
tags=tags,
864852
volumes=volumes,
865-
bootscript=bootscript,
866853
dynamic_ip_required=dynamic_ip_required,
867854
routed_ip_enabled=routed_ip_enabled,
868855
public_ips=public_ips,
@@ -1270,7 +1257,6 @@ async def create_image(
12701257
arch: Arch,
12711258
zone: Optional[Zone] = None,
12721259
name: Optional[str] = None,
1273-
default_bootscript: Optional[str] = None,
12741260
extra_volumes: Optional[Dict[str, VolumeTemplate]] = None,
12751261
organization: Optional[str] = None,
12761262
project: Optional[str] = None,
@@ -1284,7 +1270,6 @@ async def create_image(
12841270
:param arch: Architecture of the image.
12851271
:param zone: Zone to target. If none is passed will use default zone from the config.
12861272
:param name: Name of the image.
1287-
:param default_bootscript: Default bootscript of the image.
12881273
:param extra_volumes: Additional volumes of the image.
12891274
:param organization: Organization ID of the image.
12901275
One-Of ('project_identifier'): at most one of 'project', 'organization' could be set.
@@ -1314,7 +1299,6 @@ async def create_image(
13141299
arch=arch,
13151300
zone=zone,
13161301
name=name or random_name(prefix="img"),
1317-
default_bootscript=default_bootscript,
13181302
extra_volumes=extra_volumes,
13191303
tags=tags,
13201304
public=public,
@@ -3940,130 +3924,6 @@ async def delete_private_nic(
39403924

39413925
self._throw_on_error(res)
39423926

3943-
async def list_bootscripts(
3944-
self,
3945-
*,
3946-
zone: Optional[Zone] = None,
3947-
arch: Optional[str] = None,
3948-
title: Optional[str] = None,
3949-
default: Optional[bool] = None,
3950-
public: Optional[bool] = None,
3951-
per_page: Optional[int] = None,
3952-
page: Optional[int] = None,
3953-
) -> ListBootscriptsResponse:
3954-
"""
3955-
List bootscripts.
3956-
:param zone: Zone to target. If none is passed will use default zone from the config.
3957-
:param arch:
3958-
:param title:
3959-
:param default:
3960-
:param public:
3961-
:param per_page:
3962-
:param page:
3963-
:return: :class:`ListBootscriptsResponse <ListBootscriptsResponse>`
3964-
:deprecated
3965-
3966-
Usage:
3967-
::
3968-
3969-
result = await api.list_bootscripts()
3970-
"""
3971-
3972-
param_zone = validate_path_param("zone", zone or self.client.default_zone)
3973-
3974-
res = self._request(
3975-
"GET",
3976-
f"/instance/v1/zones/{param_zone}/bootscripts",
3977-
params={
3978-
"arch": arch,
3979-
"default": default,
3980-
"page": page,
3981-
"per_page": per_page or self.client.default_page_size,
3982-
"public": public,
3983-
"title": title,
3984-
},
3985-
)
3986-
3987-
self._throw_on_error(res)
3988-
return unmarshal_ListBootscriptsResponse(res.json())
3989-
3990-
async def list_bootscripts_all(
3991-
self,
3992-
*,
3993-
zone: Optional[Zone] = None,
3994-
arch: Optional[str] = None,
3995-
title: Optional[str] = None,
3996-
default: Optional[bool] = None,
3997-
public: Optional[bool] = None,
3998-
per_page: Optional[int] = None,
3999-
page: Optional[int] = None,
4000-
) -> List[Bootscript]:
4001-
"""
4002-
List bootscripts.
4003-
:param zone: Zone to target. If none is passed will use default zone from the config.
4004-
:param arch:
4005-
:param title:
4006-
:param default:
4007-
:param public:
4008-
:param per_page:
4009-
:param page:
4010-
:return: :class:`List[Bootscript] <List[Bootscript]>`
4011-
:deprecated
4012-
4013-
Usage:
4014-
::
4015-
4016-
result = await api.list_bootscripts_all()
4017-
"""
4018-
4019-
return await fetch_all_pages_async(
4020-
type=ListBootscriptsResponse,
4021-
key="bootscripts",
4022-
fetcher=self.list_bootscripts,
4023-
args={
4024-
"zone": zone,
4025-
"arch": arch,
4026-
"title": title,
4027-
"default": default,
4028-
"public": public,
4029-
"per_page": per_page,
4030-
"page": page,
4031-
},
4032-
)
4033-
4034-
async def get_bootscript(
4035-
self,
4036-
*,
4037-
bootscript_id: str,
4038-
zone: Optional[Zone] = None,
4039-
) -> GetBootscriptResponse:
4040-
"""
4041-
Get bootscripts.
4042-
Get details of a bootscript with the specified ID.
4043-
:param bootscript_id:
4044-
:param zone: Zone to target. If none is passed will use default zone from the config.
4045-
:return: :class:`GetBootscriptResponse <GetBootscriptResponse>`
4046-
:deprecated
4047-
4048-
Usage:
4049-
::
4050-
4051-
result = await api.get_bootscript(
4052-
bootscript_id="example",
4053-
)
4054-
"""
4055-
4056-
param_zone = validate_path_param("zone", zone or self.client.default_zone)
4057-
param_bootscript_id = validate_path_param("bootscript_id", bootscript_id)
4058-
4059-
res = self._request(
4060-
"GET",
4061-
f"/instance/v1/zones/{param_zone}/bootscripts/{param_bootscript_id}",
4062-
)
4063-
4064-
self._throw_on_error(res)
4065-
return unmarshal_GetBootscriptResponse(res.json())
4066-
40673927
async def get_dashboard(
40683928
self,
40693929
*,

0 commit comments

Comments
 (0)