|
43 | 43 | SnapshotVolumeType,
|
44 | 44 | VolumeVolumeType,
|
45 | 45 | ApplyBlockMigrationRequest,
|
| 46 | + AttachServerFileSystemRequest, |
| 47 | + AttachServerFileSystemResponse, |
46 | 48 | AttachServerVolumeRequest,
|
47 | 49 | AttachServerVolumeResponse,
|
48 | 50 | Bootscript,
|
|
65 | 67 | CreateSnapshotResponse,
|
66 | 68 | CreateVolumeRequest,
|
67 | 69 | CreateVolumeResponse,
|
| 70 | + DetachServerFileSystemRequest, |
| 71 | + DetachServerFileSystemResponse, |
68 | 72 | DetachServerVolumeRequest,
|
69 | 73 | DetachServerVolumeResponse,
|
70 | 74 | ExportSnapshotRequest,
|
|
151 | 155 | )
|
152 | 156 | from .marshalling import (
|
153 | 157 | unmarshal_PrivateNIC,
|
| 158 | + unmarshal_AttachServerFileSystemResponse, |
154 | 159 | unmarshal_AttachServerVolumeResponse,
|
155 | 160 | unmarshal_CreateImageResponse,
|
156 | 161 | unmarshal_CreateIpResponse,
|
|
161 | 166 | unmarshal_CreateServerResponse,
|
162 | 167 | unmarshal_CreateSnapshotResponse,
|
163 | 168 | unmarshal_CreateVolumeResponse,
|
| 169 | + unmarshal_DetachServerFileSystemResponse, |
164 | 170 | unmarshal_DetachServerVolumeResponse,
|
165 | 171 | unmarshal_ExportSnapshotResponse,
|
166 | 172 | unmarshal_GetDashboardResponse,
|
|
209 | 215 | unmarshal__SetServerResponse,
|
210 | 216 | unmarshal__SetSnapshotResponse,
|
211 | 217 | marshal_ApplyBlockMigrationRequest,
|
| 218 | + marshal_AttachServerFileSystemRequest, |
212 | 219 | marshal_AttachServerVolumeRequest,
|
213 | 220 | marshal_CheckBlockMigrationOrganizationQuotasRequest,
|
214 | 221 | marshal_CreateImageRequest,
|
|
220 | 227 | marshal_CreateServerRequest,
|
221 | 228 | marshal_CreateSnapshotRequest,
|
222 | 229 | marshal_CreateVolumeRequest,
|
| 230 | + marshal_DetachServerFileSystemRequest, |
223 | 231 | marshal_DetachServerVolumeRequest,
|
224 | 232 | marshal_ExportSnapshotRequest,
|
225 | 233 | marshal_PlanBlockMigrationRequest,
|
@@ -1167,6 +1175,90 @@ async def detach_server_volume(
|
1167 | 1175 | self._throw_on_error(res)
|
1168 | 1176 | return unmarshal_DetachServerVolumeResponse(res.json())
|
1169 | 1177 |
|
| 1178 | + async def attach_server_file_system( |
| 1179 | + self, |
| 1180 | + *, |
| 1181 | + server_id: str, |
| 1182 | + filesystem_id: str, |
| 1183 | + zone: Optional[ScwZone] = None, |
| 1184 | + ) -> AttachServerFileSystemResponse: |
| 1185 | + """ |
| 1186 | + Attach a filesystem volume to an Instance. |
| 1187 | + :param server_id: |
| 1188 | + :param filesystem_id: |
| 1189 | + :param zone: Zone to target. If none is passed will use default zone from the config. |
| 1190 | + :return: :class:`AttachServerFileSystemResponse <AttachServerFileSystemResponse>` |
| 1191 | +
|
| 1192 | + Usage: |
| 1193 | + :: |
| 1194 | +
|
| 1195 | + result = await api.attach_server_file_system( |
| 1196 | + server_id="example", |
| 1197 | + filesystem_id="example", |
| 1198 | + ) |
| 1199 | + """ |
| 1200 | + |
| 1201 | + param_zone = validate_path_param("zone", zone or self.client.default_zone) |
| 1202 | + param_server_id = validate_path_param("server_id", server_id) |
| 1203 | + |
| 1204 | + res = self._request( |
| 1205 | + "POST", |
| 1206 | + f"/instance/v1/zones/{param_zone}/servers/{param_server_id}/attach-filesystem", |
| 1207 | + body=marshal_AttachServerFileSystemRequest( |
| 1208 | + AttachServerFileSystemRequest( |
| 1209 | + server_id=server_id, |
| 1210 | + filesystem_id=filesystem_id, |
| 1211 | + zone=zone, |
| 1212 | + ), |
| 1213 | + self.client, |
| 1214 | + ), |
| 1215 | + ) |
| 1216 | + |
| 1217 | + self._throw_on_error(res) |
| 1218 | + return unmarshal_AttachServerFileSystemResponse(res.json()) |
| 1219 | + |
| 1220 | + async def detach_server_file_system( |
| 1221 | + self, |
| 1222 | + *, |
| 1223 | + server_id: str, |
| 1224 | + filesystem_id: str, |
| 1225 | + zone: Optional[ScwZone] = None, |
| 1226 | + ) -> DetachServerFileSystemResponse: |
| 1227 | + """ |
| 1228 | + Detach a filesystem volume to an Instance. |
| 1229 | + :param server_id: |
| 1230 | + :param filesystem_id: |
| 1231 | + :param zone: Zone to target. If none is passed will use default zone from the config. |
| 1232 | + :return: :class:`DetachServerFileSystemResponse <DetachServerFileSystemResponse>` |
| 1233 | +
|
| 1234 | + Usage: |
| 1235 | + :: |
| 1236 | +
|
| 1237 | + result = await api.detach_server_file_system( |
| 1238 | + server_id="example", |
| 1239 | + filesystem_id="example", |
| 1240 | + ) |
| 1241 | + """ |
| 1242 | + |
| 1243 | + param_zone = validate_path_param("zone", zone or self.client.default_zone) |
| 1244 | + param_server_id = validate_path_param("server_id", server_id) |
| 1245 | + |
| 1246 | + res = self._request( |
| 1247 | + "POST", |
| 1248 | + f"/instance/v1/zones/{param_zone}/servers/{param_server_id}/detach-filesystem", |
| 1249 | + body=marshal_DetachServerFileSystemRequest( |
| 1250 | + DetachServerFileSystemRequest( |
| 1251 | + server_id=server_id, |
| 1252 | + filesystem_id=filesystem_id, |
| 1253 | + zone=zone, |
| 1254 | + ), |
| 1255 | + self.client, |
| 1256 | + ), |
| 1257 | + ) |
| 1258 | + |
| 1259 | + self._throw_on_error(res) |
| 1260 | + return unmarshal_DetachServerFileSystemResponse(res.json()) |
| 1261 | + |
1170 | 1262 | async def list_images(
|
1171 | 1263 | self,
|
1172 | 1264 | *,
|
|
0 commit comments