|
108 | 108 | ServerActionRequest, |
109 | 109 | ServerActionRequestVolumeBackupTemplate, |
110 | 110 | ServerActionResponse, |
| 111 | + ServerCompatibleTypes, |
111 | 112 | ServerIp, |
112 | 113 | ServerIpv6, |
113 | 114 | ServerLocation, |
|
189 | 190 | unmarshal_ListVolumesTypesResponse, |
190 | 191 | unmarshal_MigrationPlan, |
191 | 192 | unmarshal_ServerActionResponse, |
| 193 | + unmarshal_ServerCompatibleTypes, |
192 | 194 | unmarshal_SetPlacementGroupResponse, |
193 | 195 | unmarshal_SetPlacementGroupServersResponse, |
194 | 196 | unmarshal_SetSecurityGroupRulesResponse, |
@@ -1036,6 +1038,43 @@ async def delete_server_user_data( |
1036 | 1038 |
|
1037 | 1039 | self._throw_on_error(res) |
1038 | 1040 |
|
| 1041 | + async def get_server_compatible_types( |
| 1042 | + self, |
| 1043 | + *, |
| 1044 | + server_id: str, |
| 1045 | + zone: Optional[ScwZone] = None, |
| 1046 | + ) -> ServerCompatibleTypes: |
| 1047 | + """ |
| 1048 | + Get Instance compatible types. |
| 1049 | + Get compatible commercial types that can be used to update the Instance. The compatibility of an Instance offer is based on: |
| 1050 | + * the CPU architecture |
| 1051 | + * the OS type |
| 1052 | + * the required l_ssd storage size |
| 1053 | + * the required scratch storage size |
| 1054 | + If the specified Instance offer is flagged as end of service, the best compatible offer is the first returned. |
| 1055 | + :param server_id: UUID of the Instance you want to get. |
| 1056 | + :param zone: Zone to target. If none is passed will use default zone from the config. |
| 1057 | + :return: :class:`ServerCompatibleTypes <ServerCompatibleTypes>` |
| 1058 | +
|
| 1059 | + Usage: |
| 1060 | + :: |
| 1061 | +
|
| 1062 | + result = await api.get_server_compatible_types( |
| 1063 | + server_id="example", |
| 1064 | + ) |
| 1065 | + """ |
| 1066 | + |
| 1067 | + param_zone = validate_path_param("zone", zone or self.client.default_zone) |
| 1068 | + param_server_id = validate_path_param("server_id", server_id) |
| 1069 | + |
| 1070 | + res = self._request( |
| 1071 | + "GET", |
| 1072 | + f"/instance/v1/zones/{param_zone}/servers/{param_server_id}/compatible-types", |
| 1073 | + ) |
| 1074 | + |
| 1075 | + self._throw_on_error(res) |
| 1076 | + return unmarshal_ServerCompatibleTypes(res.json()) |
| 1077 | + |
1039 | 1078 | async def attach_server_volume( |
1040 | 1079 | self, |
1041 | 1080 | *, |
|
0 commit comments