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

Function getInstance

compute/getInstance.js:33–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31 const compute = require('@google-cloud/compute');
32
33 async function getInstance() {
34 const instancesClient = new compute.InstancesClient();
35
36 const [instance] = await instancesClient.get({
37 project: projectId,
38 zone,
39 instance: instanceName,
40 });
41
42 console.log(
43 `Instance ${instanceName} data:\n${JSON.stringify(instance, null, 4)}`
44 );
45 }
46 getInstance();
47 // [END compute_instances_get]
48}

Callers 1

mainFunction · 0.70

Calls 1

getMethod · 0.45

Tested by

no test coverage detected