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

Function deleteReservation

compute/test/util.js:123–144  ·  view source on GitHub ↗
(zone, reservationName)

Source from the content-addressed store, hash-verified

121}
122
123async function deleteReservation(zone, reservationName) {
124 const projectId = await reservationsClient.getProjectId();
125
126 const [response] = await reservationsClient.delete({
127 project: projectId,
128 reservation: reservationName,
129 zone,
130 });
131 let operation = response.latestResponse;
132 const operationsClient = new compute.ZoneOperationsClient();
133
134 console.log(`Deleting ${reservationName}`);
135
136 // Wait for the delete operation to complete.
137 while (operation.status !== 'DONE') {
138 [operation] = await operationsClient.wait({
139 operation: operation.name,
140 project: projectId,
141 zone,
142 });
143 }
144}
145
146const storagePoolsClient = new compute.StoragePoolsClient();
147

Calls 1

getProjectIdMethod · 0.80

Tested by

no test coverage detected