| 62 | }; |
| 63 | |
| 64 | const deleteDisk = async (projectId, zone, diskName) => { |
| 65 | const [response] = await disksClient.delete({ |
| 66 | project: projectId, |
| 67 | zone, |
| 68 | disk: diskName, |
| 69 | }); |
| 70 | let operation = response.latestResponse; |
| 71 | const operationsClient = new compute.ZoneOperationsClient(); |
| 72 | |
| 73 | while (operation.status !== 'DONE') { |
| 74 | [operation] = await operationsClient.wait({ |
| 75 | operation: operation.name, |
| 76 | project: projectId, |
| 77 | zone: operation.zone.split('/').pop(), |
| 78 | }); |
| 79 | } |
| 80 | }; |
| 81 | |
| 82 | const createDiskSnapshot = async (projectId, zone, diskName, snapshotName) => { |
| 83 | const [response] = await disksClient.createSnapshot({ |