|
50 | 50 | ListNodesResponse, |
51 | 51 | ListPoolsResponse, |
52 | 52 | ListVersionsResponse, |
| 53 | + MigratePoolsToNewImagesRequest, |
53 | 54 | Node, |
54 | 55 | NodeMetadata, |
55 | 56 | Pool, |
|
92 | 93 | marshal_AddClusterACLRulesRequest, |
93 | 94 | marshal_CreateClusterRequest, |
94 | 95 | marshal_CreatePoolRequest, |
| 96 | + marshal_MigratePoolsToNewImagesRequest, |
95 | 97 | marshal_SetClusterACLRulesRequest, |
96 | 98 | marshal_SetClusterTypeRequest, |
97 | 99 | marshal_UpdateClusterRequest, |
@@ -1346,6 +1348,48 @@ async def delete_pool( |
1346 | 1348 | self._throw_on_error(res) |
1347 | 1349 | return unmarshal_Pool(res.json()) |
1348 | 1350 |
|
| 1351 | + async def migrate_pools_to_new_images( |
| 1352 | + self, |
| 1353 | + *, |
| 1354 | + cluster_id: str, |
| 1355 | + region: Optional[ScwRegion] = None, |
| 1356 | + pool_ids: Optional[list[str]] = None, |
| 1357 | + ) -> None: |
| 1358 | + """ |
| 1359 | + Migrate specific pools or all pools of a cluster to new images. |
| 1360 | + If no pool is specified, all pools of the cluster will be migrated to new images. |
| 1361 | + :param cluster_id: |
| 1362 | + :param region: Region to target. If none is passed will use default region from the config. |
| 1363 | + :param pool_ids: |
| 1364 | +
|
| 1365 | + Usage: |
| 1366 | + :: |
| 1367 | +
|
| 1368 | + result = await api.migrate_pools_to_new_images( |
| 1369 | + cluster_id="example", |
| 1370 | + ) |
| 1371 | + """ |
| 1372 | + |
| 1373 | + param_region = validate_path_param( |
| 1374 | + "region", region or self.client.default_region |
| 1375 | + ) |
| 1376 | + param_cluster_id = validate_path_param("cluster_id", cluster_id) |
| 1377 | + |
| 1378 | + res = self._request( |
| 1379 | + "POST", |
| 1380 | + f"/k8s/v1/regions/{param_region}/clusters/{param_cluster_id}/migrate-pools-to-new-images", |
| 1381 | + body=marshal_MigratePoolsToNewImagesRequest( |
| 1382 | + MigratePoolsToNewImagesRequest( |
| 1383 | + cluster_id=cluster_id, |
| 1384 | + region=region, |
| 1385 | + pool_ids=pool_ids, |
| 1386 | + ), |
| 1387 | + self.client, |
| 1388 | + ), |
| 1389 | + ) |
| 1390 | + |
| 1391 | + self._throw_on_error(res) |
| 1392 | + |
1349 | 1393 | async def get_node_metadata( |
1350 | 1394 | self, |
1351 | 1395 | *, |
|
0 commit comments