|
37 | 37 | import compute.deleteprotection.SetDeleteProtection; |
38 | 38 | import compute.disks.DeleteDisk; |
39 | 39 | import compute.disks.DeleteSnapshot; |
40 | | -import compute.disks.RegionalDelete; |
41 | 40 | import compute.reservation.DeleteReservation; |
42 | 41 | import java.io.IOException; |
43 | 42 | import java.nio.charset.StandardCharsets; |
@@ -267,22 +266,6 @@ public static void deleteStoragePool(String project, String zone, String storage |
267 | 266 | } |
268 | 267 | } |
269 | 268 |
|
270 | | - // Delete disks which starts with the given prefixToDelete and |
271 | | - // has creation timestamp >24 hours. |
272 | | - public static void cleanUpExistingRegionalDisks( |
273 | | - String prefixToDelete, String projectId, String region) |
274 | | - throws IOException, ExecutionException, InterruptedException, TimeoutException { |
275 | | - try (RegionDisksClient disksClient = RegionDisksClient.create()) { |
276 | | - for (Disk disk : disksClient.list(projectId, region).iterateAll()) { |
277 | | - if (disk.getName().contains(prefixToDelete) |
278 | | - && disk.getRegion().equals(region) |
279 | | - && isCreatedBeforeThresholdTime(disk.getCreationTimestamp())) { |
280 | | - RegionalDelete.deleteRegionalDisk(projectId, region, disk.getName()); |
281 | | - } |
282 | | - } |
283 | | - } |
284 | | - } |
285 | | - |
286 | 269 | public static boolean containPrefixToDeleteAndZone( |
287 | 270 | Object resource, String prefixToDelete, String zone) { |
288 | 271 | boolean containPrefixAndZone = false; |
|
0 commit comments