Skip to content

Commit 3a32246

Browse files
authored
docs(instance): add UpdateServer commercial_type documentation (#254)
1 parent 67b546c commit 3a32246

File tree

6 files changed

+34
-0
lines changed

6 files changed

+34
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,7 @@ async def _update_server(
721721
security_group: Optional[SecurityGroupTemplate] = None,
722722
placement_group: Optional[str] = None,
723723
private_nics: Optional[List[PrivateNIC]] = None,
724+
commercial_type: Optional[str] = None,
724725
) -> UpdateServerResponse:
725726
"""
726727
Update an Instance.
@@ -740,6 +741,11 @@ async def _update_server(
740741
:param security_group:
741742
:param placement_group: Placement group ID if Instance must be part of a placement group.
742743
:param private_nics: Instance private NICs.
744+
:param commercial_type: Set the commercial_type for this Instance.
745+
Warning: This field has some restrictions:
746+
- Cannot be changed if the Instance is not in `stopped` state.
747+
- Cannot be changed if the Instance is in a placement group.
748+
- Local storage requirements of the target commercial_types must be fulfilled (i.e. if an Instance has 80GB of local storage, it can be changed into a GP1-XS, which has a maximum of 150GB, but it cannot be changed into a DEV1-S, which has only 20GB).
743749
:return: :class:`UpdateServerResponse <UpdateServerResponse>`
744750
745751
Usage:
@@ -771,6 +777,7 @@ async def _update_server(
771777
security_group=security_group,
772778
placement_group=placement_group,
773779
private_nics=private_nics,
780+
commercial_type=commercial_type,
774781
),
775782
self.client,
776783
),

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2935,6 +2935,7 @@ def marshal__UpdateServerRequest(
29352935
if request.boot_type is not None
29362936
else None,
29372937
"bootscript": request.bootscript,
2938+
"commercial_type": request.commercial_type,
29382939
"dynamic_ip_required": request.dynamic_ip_required,
29392940
"enable_ipv6": request.enable_ipv6,
29402941
"name": request.name,

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,15 @@ class _UpdateServerRequest:
397397
Instance private NICs.
398398
"""
399399

400+
commercial_type: Optional[str]
401+
"""
402+
Set the commercial_type for this Instance.
403+
Warning: This field has some restrictions:
404+
- Cannot be changed if the Instance is not in `stopped` state.
405+
- Cannot be changed if the Instance is in a placement group.
406+
- Local storage requirements of the target commercial_types must be fulfilled (i.e. if an Instance has 80GB of local storage, it can be changed into a GP1-XS, which has a maximum of 150GB, but it cannot be changed into a DEV1-S, which has only 20GB).
407+
"""
408+
400409

401410
@dataclass
402411
class _SetImageRequest:

scaleway/scaleway/instance/v1/api.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,7 @@ def _update_server(
721721
security_group: Optional[SecurityGroupTemplate] = None,
722722
placement_group: Optional[str] = None,
723723
private_nics: Optional[List[PrivateNIC]] = None,
724+
commercial_type: Optional[str] = None,
724725
) -> UpdateServerResponse:
725726
"""
726727
Update an Instance.
@@ -740,6 +741,11 @@ def _update_server(
740741
:param security_group:
741742
:param placement_group: Placement group ID if Instance must be part of a placement group.
742743
:param private_nics: Instance private NICs.
744+
:param commercial_type: Set the commercial_type for this Instance.
745+
Warning: This field has some restrictions:
746+
- Cannot be changed if the Instance is not in `stopped` state.
747+
- Cannot be changed if the Instance is in a placement group.
748+
- Local storage requirements of the target commercial_types must be fulfilled (i.e. if an Instance has 80GB of local storage, it can be changed into a GP1-XS, which has a maximum of 150GB, but it cannot be changed into a DEV1-S, which has only 20GB).
743749
:return: :class:`UpdateServerResponse <UpdateServerResponse>`
744750
745751
Usage:
@@ -771,6 +777,7 @@ def _update_server(
771777
security_group=security_group,
772778
placement_group=placement_group,
773779
private_nics=private_nics,
780+
commercial_type=commercial_type,
774781
),
775782
self.client,
776783
),

scaleway/scaleway/instance/v1/marshalling.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2935,6 +2935,7 @@ def marshal__UpdateServerRequest(
29352935
if request.boot_type is not None
29362936
else None,
29372937
"bootscript": request.bootscript,
2938+
"commercial_type": request.commercial_type,
29382939
"dynamic_ip_required": request.dynamic_ip_required,
29392940
"enable_ipv6": request.enable_ipv6,
29402941
"name": request.name,

scaleway/scaleway/instance/v1/types_private.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,15 @@ class _UpdateServerRequest:
397397
Instance private NICs.
398398
"""
399399

400+
commercial_type: Optional[str]
401+
"""
402+
Set the commercial_type for this Instance.
403+
Warning: This field has some restrictions:
404+
- Cannot be changed if the Instance is not in `stopped` state.
405+
- Cannot be changed if the Instance is in a placement group.
406+
- Local storage requirements of the target commercial_types must be fulfilled (i.e. if an Instance has 80GB of local storage, it can be changed into a GP1-XS, which has a maximum of 150GB, but it cannot be changed into a DEV1-S, which has only 20GB).
407+
"""
408+
400409

401410
@dataclass
402411
class _SetImageRequest:

0 commit comments

Comments
 (0)