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

Function deleteDisk

compute/test/snapshots.test.js:79–95  ·  view source on GitHub ↗
(projectId, zone, diskName)

Source from the content-addressed store, hash-verified

77};
78
79const deleteDisk = async (projectId, zone, diskName) => {
80 const [response] = await disksClient.delete({
81 project: projectId,
82 zone,
83 disk: diskName,
84 });
85 let operation = response.latestResponse;
86 const operationsClient = new compute.ZoneOperationsClient();
87
88 while (operation.status !== 'DONE') {
89 [operation] = await operationsClient.wait({
90 operation: operation.name,
91 project: projectId,
92 zone: operation.zone.split('/').pop(),
93 });
94 }
95};
96
97const deleteRegionDisk = async (projectId, region, diskName) => {
98 const [response] = await regionDisksClient.delete({

Callers 1

snapshots.test.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected