function main(projectId, zone, instanceName) {
  // [START compute_resume_instance]
  /**
   * 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');

  // Resumes a suspended Google Compute Engine instance (with unencrypted disks).
  async function resumeInstance() {
    const instancesClient = new compute.InstancesClient();

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

    if (instance.status !== 'SUSPENDED') {
      throw new Error(
        'Only suspended instances can be resumed.' +
          `Instance ${instanceName} is in ${instance.status} state.`
      );
    }

    const [response] = await instancesClient.resume({
      project: projectId,
      zone,
      instance: instanceName,
    });
    let operation = response.latestResponse;
    const operationsClient = new compute.ZoneOperationsClient();

    // Wait for the create operation to complete.
    while (operation.status !== 'DONE') {
      [operation] = await operationsClient.wait({
        operation: operation.name,
        project: projectId,
        zone: operation.zone.split('/').pop(),
      });
    }

    console.log('Instance resumed.');
  }

  resumeInstance();
  // [END compute_resume_instance]
}
Resumes a suspended Google Compute Engine instance (with unencrypted disks).

@param {string} projectId - Project ID or project number of the Cloud project you want to use.
@param {string} zone - Name of the zone to create the instance in. For example: "us-west3-b"
@param {string} instanceName - Name of the new virtual machine (VM) instance.