diff --git a/compute/createInstance.js b/compute/createInstance.js index c9b32a815e..46df9d671b 100644 --- a/compute/createInstance.js +++ b/compute/createInstance.js @@ -60,7 +60,7 @@ function main( console.log(`Creating the ${instanceName} instance in ${zone}...`); - let [operation] = await instancesClient.insert({ + const [response] = await instancesClient.insert({ instanceResource: { name: instanceName, disks: [ @@ -86,7 +86,7 @@ function main( project: projectId, zone, }); - + let operation = response.latestResponse; const operationsClient = new compute.ZoneOperationsClient(); // Wait for the create operation to complete. diff --git a/compute/deleteInstance.js b/compute/deleteInstance.js index bd1a4858d0..2c604dd3a1 100644 --- a/compute/deleteInstance.js +++ b/compute/deleteInstance.js @@ -36,12 +36,12 @@ function main(projectId, zone, instanceName) { console.log(`Deleting ${instanceName} from ${zone}...`); - let [operation] = await instancesClient.delete({ + const [response] = await instancesClient.delete({ project: projectId, zone, instance: instanceName, }); - + let operation = response.latestResponse; const operationsClient = new compute.ZoneOperationsClient(); // Wait for the delete operation to complete. diff --git a/compute/package.json b/compute/package.json index 7a99f4a339..7fc9fcc26b 100644 --- a/compute/package.json +++ b/compute/package.json @@ -14,7 +14,7 @@ "test": "mocha test --timeout 1200000" }, "dependencies": { - "@google-cloud/compute": "^3.0.0", + "@google-cloud/compute": "^3.0.0-alpha.4", "@sendgrid/mail": "^7.0.0", "nodemailer": "^6.0.0", "nodemailer-smtp-transport": "^2.7.4" diff --git a/compute/test/samples.test.js b/compute/test/samples.test.js index 982db6a60e..f6acce59b6 100644 --- a/compute/test/samples.test.js +++ b/compute/test/samples.test.js @@ -69,13 +69,13 @@ describe('samples', () => { execSync(`node createInstance ${projectId} ${zone} ${newinstanceName}`); - const [operation] = await instancesClient.delete({ + const [response] = await instancesClient.delete({ project: projectId, zone, instance: newinstanceName, }); - const operationString = JSON.stringify(operation); + const operationString = JSON.stringify(response.latestResponse); const output = execSync( `node waitForOperation ${projectId} '${operationString}'`