|
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; |
@@ -218,22 +217,6 @@ && isCreatedBeforeThresholdTime(disk.getCreationTimestamp())) { |
218 | 217 | } |
219 | 218 | } |
220 | 219 |
|
221 | | - // Delete regional disks which starts with the given prefixToDelete and |
222 | | - // has creation timestamp >24 hours. |
223 | | - public static void cleanUpExistingRegionalDisks( |
224 | | - String prefixToDelete, String projectId, String region) |
225 | | - throws IOException, ExecutionException, InterruptedException, TimeoutException { |
226 | | - try (RegionDisksClient disksClient = RegionDisksClient.create()) { |
227 | | - for (Disk disk : disksClient.list(projectId, region).iterateAll()) { |
228 | | - if (disk.getName().contains(prefixToDelete) |
229 | | - && disk.getRegion().equals(region) |
230 | | - && isCreatedBeforeThresholdTime(disk.getCreationTimestamp())) { |
231 | | - RegionalDelete.deleteRegionalDisk(projectId, region, disk.getName()); |
232 | | - } |
233 | | - } |
234 | | - } |
235 | | - } |
236 | | - |
237 | 220 | // Delete snapshots which starts with the given prefixToDelete and |
238 | 221 | // has creation timestamp >24 hours. |
239 | 222 | public static void cleanUpExistingSnapshots(String prefixToDelete, String projectId) |
|
0 commit comments