(zone, diskName)
| 240 | } |
| 241 | |
| 242 | async function deleteDisk(zone, diskName) { |
| 243 | const projectId = await disksClient.getProjectId(); |
| 244 | |
| 245 | const [response] = await disksClient.delete({ |
| 246 | project: projectId, |
| 247 | disk: diskName, |
| 248 | zone, |
| 249 | }); |
| 250 | let operation = response.latestResponse; |
| 251 | const operationsClient = new compute.ZoneOperationsClient(); |
| 252 | |
| 253 | console.log(`Deleting ${diskName}`); |
| 254 | |
| 255 | // Wait for the delete operation to complete. |
| 256 | while (operation.status !== 'DONE') { |
| 257 | [operation] = await operationsClient.wait({ |
| 258 | operation: operation.name, |
| 259 | project: projectId, |
| 260 | zone, |
| 261 | }); |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | module.exports = { |
| 266 | generateTestId, |
no test coverage detected