function main(projectId, zone, instanceName) {
  // [START compute_instances_get]
  /**
   * TODO(developer): Uncomment and replace these variables before running the sample.
   */
  // const projectId = 'YOUR_PROJECT_ID';
  // const zone = 'europe-central2-b'
  // const instanceName = 'YOUR_INSTANCE_NAME'

  const compute = require('@google-cloud/compute');

  async function getInstance() {
    const instancesClient = new compute.InstancesClient();

    const [instance] = await instancesClient.get({
      project: projectId,
      zone,
      instance: instanceName,
    });

    console.log(
      `Instance ${instanceName} data:\n${JSON.stringify(instance, null, 4)}`
    );
  }
  getInstance();
  // [END compute_instances_get]
}
Prints information about a VM instance in the given zone in the specified project.

@param {string} projectId - Project ID or project number of the Cloud project you want to use.
@param {string} zone - Name of the zone you want to use. For example: 'us-west3-b'.
@param {string} instanceName - Name of the VM instance you want to query.