MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / deleteDisk

Function deleteDisk

compute/test/disks.test.js:64–80  ·  view source on GitHub ↗
(projectId, zone, diskName)

Source from the content-addressed store, hash-verified

62};
63
64const 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
82const createDiskSnapshot = async (projectId, zone, diskName, snapshotName) => {
83 const [response] = await disksClient.createSnapshot({

Callers 1

disks.test.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected