Google Compute Engine: Node.js Client

release level npm version

Google Compute Engine Client Library for Node.js

A comprehensive list of changes in each version may be found in the CHANGELOG.

Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in Client Libraries Explained.

Table of contents:

Quickstart

Before you begin

  1. Select or create a Cloud Platform project.
  2. Enable billing for your project.
  3. Enable the Google Compute Engine API.
  4. Set up authentication with a service account so you can access the API from your local workstation.

Installing the client library

npm install @google-cloud/compute

Using the client library

/**
 * TODO(developer): Uncomment and replace these variables before running the sample.
 */
// const projectId = 'YOUR_PROJECT_ID';

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

// List all instances in the specified project.
async function listAllInstances() {
  const instancesClient = new compute.InstancesClient();

  //Use the `maxResults` parameter to limit the number of results that the API returns per response page.
  const aggListRequest = instancesClient.aggregatedListAsync({
    project: projectId,
    maxResults: 5,
  });

  console.log('Instances found:');

  // Despite using the `maxResults` parameter, you don't need to handle the pagination
  // yourself. The returned object handles pagination automatically,
  // requesting next pages as you iterate over the results.
  for await (const [zone, instancesObject] of aggListRequest) {
    const instances = instancesObject.instances;

    if (instances && instances.length > 0) {
      console.log(` ${zone}`);
      for (const instance of instances) {
        console.log(` - ${instance.name} (${instance.machineType})`);
      }
    }
  }
}

listAllInstances();

Samples

Samples are in the samples/ directory. Each sample's README.md has instructions for running its sample.

SampleSource CodeTry it
Accelerator_types.aggregated_listsource codeOpen in Cloud Shell
Accelerator_types.getsource codeOpen in Cloud Shell
Accelerator_types.listsource codeOpen in Cloud Shell
Addresses.aggregated_listsource codeOpen in Cloud Shell
Addresses.deletesource codeOpen in Cloud Shell
Addresses.getsource codeOpen in Cloud Shell
Addresses.insertsource codeOpen in Cloud Shell
Addresses.listsource codeOpen in Cloud Shell
Addresses.set_labelssource codeOpen in Cloud Shell
Autoscalers.aggregated_listsource codeOpen in Cloud Shell
Autoscalers.deletesource codeOpen in Cloud Shell
Autoscalers.getsource codeOpen in Cloud Shell
Autoscalers.insertsource codeOpen in Cloud Shell
Autoscalers.listsource codeOpen in Cloud Shell
Autoscalers.patchsource codeOpen in Cloud Shell
Autoscalers.updatesource codeOpen in Cloud Shell
Backend_buckets.add_signed_url_keysource codeOpen in Cloud Shell
Backend_buckets.deletesource codeOpen in Cloud Shell
Backend_buckets.delete_signed_url_keysource codeOpen in Cloud Shell
Backend_buckets.getsource codeOpen in Cloud Shell
Backend_buckets.insertsource codeOpen in Cloud Shell
Backend_buckets.listsource codeOpen in Cloud Shell
Backend_buckets.patchsource codeOpen in Cloud Shell
Backend_buckets.set_edge_security_policysource codeOpen in Cloud Shell
Backend_buckets.updatesource codeOpen in Cloud Shell
Backend_services.add_signed_url_keysource codeOpen in Cloud Shell
Backend_services.aggregated_listsource codeOpen in Cloud Shell
Backend_services.deletesource codeOpen in Cloud Shell
Backend_services.delete_signed_url_keysource codeOpen in Cloud Shell
Backend_services.getsource codeOpen in Cloud Shell
Backend_services.get_healthsource codeOpen in Cloud Shell
Backend_services.get_iam_policysource codeOpen in Cloud Shell
Backend_services.insertsource codeOpen in Cloud Shell
Backend_services.listsource codeOpen in Cloud Shell
Backend_services.patchsource codeOpen in Cloud Shell
Backend_services.set_edge_security_policysource codeOpen in Cloud Shell
Backend_services.set_iam_policysource codeOpen in Cloud Shell
Backend_services.set_security_policysource codeOpen in Cloud Shell
Backend_services.updatesource codeOpen in Cloud Shell
Disk_types.aggregated_listsource codeOpen in Cloud Shell
Disk_types.getsource codeOpen in Cloud Shell
Disk_types.listsource codeOpen in Cloud Shell
Disks.add_resource_policiessource codeOpen in Cloud Shell
Disks.aggregated_listsource codeOpen in Cloud Shell
Disks.create_snapshotsource codeOpen in Cloud Shell
Disks.deletesource codeOpen in Cloud Shell
Disks.getsource codeOpen in Cloud Shell
Disks.get_iam_policysource codeOpen in Cloud Shell
Disks.insertsource codeOpen in Cloud Shell
Disks.listsource codeOpen in Cloud Shell
Disks.remove_resource_policiessource codeOpen in Cloud Shell
Disks.resizesource codeOpen in Cloud Shell
Disks.set_iam_policysource codeOpen in Cloud Shell
Disks.set_labelssource codeOpen in Cloud Shell
Disks.test_iam_permissionssource codeOpen in Cloud Shell
Disks.updatesource codeOpen in Cloud Shell
External_vpn_gateways.deletesource codeOpen in Cloud Shell
External_vpn_gateways.getsource codeOpen in Cloud Shell
External_vpn_gateways.insertsource codeOpen in Cloud Shell
External_vpn_gateways.listsource codeOpen in Cloud Shell
External_vpn_gateways.set_labelssource codeOpen in Cloud Shell
External_vpn_gateways.test_iam_permissionssource codeOpen in Cloud Shell
Firewall_policies.add_associationsource codeOpen in Cloud Shell
Firewall_policies.add_rulesource codeOpen in Cloud Shell
Firewall_policies.clone_rulessource codeOpen in Cloud Shell
Firewall_policies.deletesource codeOpen in Cloud Shell
Firewall_policies.getsource codeOpen in Cloud Shell
Firewall_policies.get_associationsource codeOpen in Cloud Shell
Firewall_policies.get_iam_policysource codeOpen in Cloud Shell
Firewall_policies.get_rulesource codeOpen in Cloud Shell
Firewall_policies.insertsource codeOpen in Cloud Shell
Firewall_policies.listsource codeOpen in Cloud Shell
Firewall_policies.list_associationssource codeOpen in Cloud Shell
Firewall_policies.movesource codeOpen in Cloud Shell
Firewall_policies.patchsource codeOpen in Cloud Shell
Firewall_policies.patch_rulesource codeOpen in Cloud Shell
Firewall_policies.remove_associationsource codeOpen in Cloud Shell
Firewall_policies.remove_rulesource codeOpen in Cloud Shell
Firewall_policies.set_iam_policysource codeOpen in Cloud Shell
Firewall_policies.test_iam_permissionssource codeOpen in Cloud Shell
Firewalls.deletesource codeOpen in Cloud Shell
Firewalls.getsource codeOpen in Cloud Shell
Firewalls.insertsource codeOpen in Cloud Shell
Firewalls.listsource codeOpen in Cloud Shell
Firewalls.patchsource codeOpen in Cloud Shell
Firewalls.updatesource codeOpen in Cloud Shell
Forwarding_rules.aggregated_listsource codeOpen in Cloud Shell
Forwarding_rules.deletesource codeOpen in Cloud Shell
Forwarding_rules.getsource codeOpen in Cloud Shell
Forwarding_rules.insertsource codeOpen in Cloud Shell
Forwarding_rules.listsource codeOpen in Cloud Shell
Forwarding_rules.patchsource codeOpen in Cloud Shell
Forwarding_rules.set_labelssource codeOpen in Cloud Shell
Forwarding_rules.set_targetsource codeOpen in Cloud Shell
Global_addresses.deletesource codeOpen in Cloud Shell
Global_addresses.getsource codeOpen in Cloud Shell
Global_addresses.insertsource codeOpen in Cloud Shell
Global_addresses.listsource codeOpen in Cloud Shell
Global_addresses.set_labelssource codeOpen in Cloud Shell
Global_forwarding_rules.deletesource codeOpen in Cloud Shell
Global_forwarding_rules.getsource codeOpen in Cloud Shell
Global_forwarding_rules.insertsource codeOpen in Cloud Shell
Global_forwarding_rules.listsource codeOpen in Cloud Shell
Global_forwarding_rules.patchsource codeOpen in Cloud Shell
Global_forwarding_rules.set_labelssource codeOpen in Cloud Shell
Global_forwarding_rules.set_targetsource codeOpen in Cloud Shell
Global_network_endpoint_groups.attach_network_endpointssource codeOpen in Cloud Shell
Global_network_endpoint_groups.deletesource codeOpen in Cloud Shell
Global_network_endpoint_groups.detach_network_endpointssource codeOpen in Cloud Shell
Global_network_endpoint_groups.getsource codeOpen in Cloud Shell
Global_network_endpoint_groups.insertsource codeOpen in Cloud Shell
Global_network_endpoint_groups.listsource codeOpen in Cloud Shell
Global_network_endpoint_groups.list_network_endpointssource codeOpen in Cloud Shell
Global_operations.aggregated_listsource codeOpen in Cloud Shell
Global_operations.deletesource codeOpen in Cloud Shell
Global_operations.getsource codeOpen in Cloud Shell
Global_operations.listsource codeOpen in Cloud Shell
Global_operations.waitsource codeOpen in Cloud Shell
Global_organization_operations.deletesource codeOpen in Cloud Shell
Global_organization_operations.getsource codeOpen in Cloud Shell
Global_organization_operations.listsource codeOpen in Cloud Shell
Global_public_delegated_prefixes.deletesource codeOpen in Cloud Shell
Global_public_delegated_prefixes.getsource codeOpen in Cloud Shell
Global_public_delegated_prefixes.insertsource codeOpen in Cloud Shell
Global_public_delegated_prefixes.listsource codeOpen in Cloud Shell
Global_public_delegated_prefixes.patchsource codeOpen in Cloud Shell
Health_checks.aggregated_listsource codeOpen in Cloud Shell
Health_checks.deletesource codeOpen in Cloud Shell
Health_checks.getsource codeOpen in Cloud Shell
Health_checks.insertsource codeOpen in Cloud Shell
Health_checks.listsource codeOpen in Cloud Shell
Health_checks.patchsource codeOpen in Cloud Shell
Health_checks.updatesource codeOpen in Cloud Shell
Image_family_views.getsource codeOpen in Cloud Shell
Images.deletesource codeOpen in Cloud Shell
Images.deprecatesource codeOpen in Cloud Shell
Images.getsource codeOpen in Cloud Shell
Images.get_from_familysource codeOpen in Cloud Shell
Images.get_iam_policysource codeOpen in Cloud Shell
Images.insertsource codeOpen in Cloud Shell
Images.listsource codeOpen in Cloud Shell
Images.patchsource codeOpen in Cloud Shell
Images.set_iam_policysource codeOpen in Cloud Shell
Images.set_labelssource codeOpen in Cloud Shell
Images.test_iam_permissionssource codeOpen in Cloud Shell
Instance_group_managers.abandon_instancessource codeOpen in Cloud Shell
Instance_group_managers.aggregated_listsource codeOpen in Cloud Shell
Instance_group_managers.apply_updates_to_instancessource codeOpen in Cloud Shell
Instance_group_managers.create_instancessource codeOpen in Cloud Shell
Instance_group_managers.deletesource codeOpen in Cloud Shell
Instance_group_managers.delete_instancessource codeOpen in Cloud Shell
Instance_group_managers.delete_per_instance_configssource codeOpen in Cloud Shell
Instance_group_managers.getsource codeOpen in Cloud Shell
Instance_group_managers.insertsource codeOpen in Cloud Shell
Instance_group_managers.listsource codeOpen in Cloud Shell
Instance_group_managers.list_errorssource codeOpen in Cloud Shell
Instance_group_managers.list_managed_instancessource codeOpen in Cloud Shell
Instance_group_managers.list_per_instance_configssource codeOpen in Cloud Shell
Instance_group_managers.patchsource codeOpen in Cloud Shell
Instance_group_managers.patch_per_instance_configssource codeOpen in Cloud Shell
Instance_group_managers.recreate_instancessource codeOpen in Cloud Shell
Instance_group_managers.resizesource codeOpen in Cloud Shell
Instance_group_managers.set_instance_templatesource codeOpen in Cloud Shell
Instance_group_managers.set_target_poolssource codeOpen in Cloud Shell
Instance_group_managers.update_per_instance_configssource codeOpen in Cloud Shell
Instance_groups.add_instancessource codeOpen in Cloud Shell
Instance_groups.aggregated_listsource codeOpen in Cloud Shell
Instance_groups.deletesource codeOpen in Cloud Shell
Instance_groups.getsource codeOpen in Cloud Shell
Instance_groups.insertsource codeOpen in Cloud Shell
Instance_groups.listsource codeOpen in Cloud Shell
Instance_groups.list_instancessource codeOpen in Cloud Shell
Instance_groups.remove_instancessource codeOpen in Cloud Shell
Instance_groups.set_named_portssource codeOpen in Cloud Shell
Instance_templates.aggregated_listsource codeOpen in Cloud Shell
Instance_templates.deletesource codeOpen in Cloud Shell
Instance_templates.getsource codeOpen in Cloud Shell
Instance_templates.get_iam_policysource codeOpen in Cloud Shell
Instance_templates.insertsource codeOpen in Cloud Shell
Instance_templates.listsource codeOpen in Cloud Shell
Instance_templates.set_iam_policysource codeOpen in Cloud Shell
Instance_templates.test_iam_permissionssource codeOpen in Cloud Shell
Instances.add_access_configsource codeOpen in Cloud Shell
Instances.add_resource_policiessource codeOpen in Cloud Shell
Instances.aggregated_listsource codeOpen in Cloud Shell
Instances.attach_disksource codeOpen in Cloud Shell
Instances.bulk_insertsource codeOpen in Cloud Shell
Instances.deletesource codeOpen in Cloud Shell
Instances.delete_access_configsource codeOpen in Cloud Shell
Instances.detach_disksource codeOpen in Cloud Shell
Instances.getsource codeOpen in Cloud Shell
Instances.get_effective_firewallssource codeOpen in Cloud Shell
Instances.get_guest_attributessource codeOpen in Cloud Shell
Instances.get_iam_policysource codeOpen in Cloud Shell
Instances.get_screenshotsource codeOpen in Cloud Shell
Instances.get_serial_port_outputsource codeOpen in Cloud Shell
Instances.get_shielded_instance_identitysource codeOpen in Cloud Shell
Instances.insertsource codeOpen in Cloud Shell
Instances.listsource codeOpen in Cloud Shell
Instances.list_referrerssource codeOpen in Cloud Shell
Instances.remove_resource_policiessource codeOpen in Cloud Shell
Instances.resetsource codeOpen in Cloud Shell
Instances.resumesource codeOpen in Cloud Shell
Instances.send_diagnostic_interruptsource codeOpen in Cloud Shell
Instances.set_deletion_protectionsource codeOpen in Cloud Shell
Instances.set_disk_auto_deletesource codeOpen in Cloud Shell
Instances.set_iam_policysource codeOpen in Cloud Shell
Instances.set_labelssource codeOpen in Cloud Shell
Instances.set_machine_resourcessource codeOpen in Cloud Shell
Instances.set_machine_typesource codeOpen in Cloud Shell
Instances.set_metadatasource codeOpen in Cloud Shell
Instances.set_min_cpu_platformsource codeOpen in Cloud Shell
Instances.set_namesource codeOpen in Cloud Shell
Instances.set_schedulingsource codeOpen in Cloud Shell
Instances.set_service_accountsource codeOpen in Cloud Shell
Instances.set_shielded_instance_integrity_policysource codeOpen in Cloud Shell
Instances.set_tagssource codeOpen in Cloud Shell
Instances.simulate_maintenance_eventsource codeOpen in Cloud Shell
Instances.startsource codeOpen in Cloud Shell
Instances.start_with_encryption_keysource codeOpen in Cloud Shell
Instances.stopsource codeOpen in Cloud Shell
Instances.suspendsource codeOpen in Cloud Shell
Instances.test_iam_permissionssource codeOpen in Cloud Shell
Instances.updatesource codeOpen in Cloud Shell
Instances.update_access_configsource codeOpen in Cloud Shell
Instances.update_display_devicesource codeOpen in Cloud Shell
Instances.update_network_interfacesource codeOpen in Cloud Shell
Instances.update_shielded_instance_configsource codeOpen in Cloud Shell
Interconnect_attachments.aggregated_listsource codeOpen in Cloud Shell
Interconnect_attachments.deletesource codeOpen in Cloud Shell
Interconnect_attachments.getsource codeOpen in Cloud Shell
Interconnect_attachments.insertsource codeOpen in Cloud Shell
Interconnect_attachments.listsource codeOpen in Cloud Shell
Interconnect_attachments.patchsource codeOpen in Cloud Shell
Interconnect_attachments.set_labelssource codeOpen in Cloud Shell
Interconnect_locations.getsource codeOpen in Cloud Shell
Interconnect_locations.listsource codeOpen in Cloud Shell
Interconnects.deletesource codeOpen in Cloud Shell
Interconnects.getsource codeOpen in Cloud Shell
Interconnects.get_diagnosticssource codeOpen in Cloud Shell
Interconnects.insertsource codeOpen in Cloud Shell
Interconnects.listsource codeOpen in Cloud Shell
Interconnects.patchsource codeOpen in Cloud Shell
Interconnects.set_labelssource codeOpen in Cloud Shell
License_codes.getsource codeOpen in Cloud Shell
License_codes.test_iam_permissionssource codeOpen in Cloud Shell
Licenses.deletesource codeOpen in Cloud Shell
Licenses.getsource codeOpen in Cloud Shell
Licenses.get_iam_policysource codeOpen in Cloud Shell
Licenses.insertsource codeOpen in Cloud Shell
Licenses.listsource codeOpen in Cloud Shell
Licenses.set_iam_policysource codeOpen in Cloud Shell
Licenses.test_iam_permissionssource codeOpen in Cloud Shell
Machine_images.deletesource codeOpen in Cloud Shell
Machine_images.getsource codeOpen in Cloud Shell
Machine_images.get_iam_policysource codeOpen in Cloud Shell
Machine_images.insertsource codeOpen in Cloud Shell
Machine_images.listsource codeOpen in Cloud Shell
Machine_images.set_iam_policysource codeOpen in Cloud Shell
Machine_images.test_iam_permissionssource codeOpen in Cloud Shell
Machine_types.aggregated_listsource codeOpen in Cloud Shell
Machine_types.getsource codeOpen in Cloud Shell
Machine_types.listsource codeOpen in Cloud Shell
Network_attachments.aggregated_listsource codeOpen in Cloud Shell
Network_attachments.deletesource codeOpen in Cloud Shell
Network_attachments.getsource codeOpen in Cloud Shell
Network_attachments.get_iam_policysource codeOpen in Cloud Shell
Network_attachments.insertsource codeOpen in Cloud Shell
Network_attachments.listsource codeOpen in Cloud Shell
Network_attachments.set_iam_policysource codeOpen in Cloud Shell
Network_attachments.test_iam_permissionssource codeOpen in Cloud Shell
Network_edge_security_services.aggregated_listsource codeOpen in Cloud Shell
Network_edge_security_services.deletesource codeOpen in Cloud Shell
Network_edge_security_services.getsource codeOpen in Cloud Shell
Network_edge_security_services.insertsource codeOpen in Cloud Shell
Network_edge_security_services.patchsource codeOpen in Cloud Shell
Network_endpoint_groups.aggregated_listsource codeOpen in Cloud Shell
Network_endpoint_groups.attach_network_endpointssource codeOpen in Cloud Shell
Network_endpoint_groups.deletesource codeOpen in Cloud Shell
Network_endpoint_groups.detach_network_endpointssource codeOpen in Cloud Shell
Network_endpoint_groups.getsource codeOpen in Cloud Shell
Network_endpoint_groups.insertsource codeOpen in Cloud Shell
Network_endpoint_groups.listsource codeOpen in Cloud Shell
Network_endpoint_groups.list_network_endpointssource codeOpen in Cloud Shell
Network_endpoint_groups.test_iam_permissionssource codeOpen in Cloud Shell
Network_firewall_policies.add_associationsource codeOpen in Cloud Shell
Network_firewall_policies.add_rulesource codeOpen in Cloud Shell
Network_firewall_policies.clone_rulessource codeOpen in Cloud Shell
Network_firewall_policies.deletesource codeOpen in Cloud Shell
Network_firewall_policies.getsource codeOpen in Cloud Shell
Network_firewall_policies.get_associationsource codeOpen in Cloud Shell
Network_firewall_policies.get_iam_policysource codeOpen in Cloud Shell
Network_firewall_policies.get_rulesource codeOpen in Cloud Shell
Network_firewall_policies.insertsource codeOpen in Cloud Shell
Network_firewall_policies.listsource codeOpen in Cloud Shell
Network_firewall_policies.patchsource codeOpen in Cloud Shell
Network_firewall_policies.patch_rulesource codeOpen in Cloud Shell
Network_firewall_policies.remove_associationsource codeOpen in Cloud Shell
Network_firewall_policies.remove_rulesource codeOpen in Cloud Shell
Network_firewall_policies.set_iam_policysource codeOpen in Cloud Shell
Network_firewall_policies.test_iam_permissionssource codeOpen in Cloud Shell
Networks.add_peeringsource codeOpen in Cloud Shell
Networks.deletesource codeOpen in Cloud Shell
Networks.getsource codeOpen in Cloud Shell
Networks.get_effective_firewallssource codeOpen in Cloud Shell
Networks.insertsource codeOpen in Cloud Shell
Networks.listsource codeOpen in Cloud Shell
Networks.list_peering_routessource codeOpen in Cloud Shell
Networks.patchsource codeOpen in Cloud Shell
Networks.remove_peeringsource codeOpen in Cloud Shell
Networks.switch_to_custom_modesource codeOpen in Cloud Shell
Networks.update_peeringsource codeOpen in Cloud Shell
Node_groups.add_nodessource codeOpen in Cloud Shell
Node_groups.aggregated_listsource codeOpen in Cloud Shell
Node_groups.deletesource codeOpen in Cloud Shell
Node_groups.delete_nodessource codeOpen in Cloud Shell
Node_groups.getsource codeOpen in Cloud Shell
Node_groups.get_iam_policysource codeOpen in Cloud Shell
Node_groups.insertsource codeOpen in Cloud Shell
Node_groups.listsource codeOpen in Cloud Shell
Node_groups.list_nodessource codeOpen in Cloud Shell
Node_groups.patchsource codeOpen in Cloud Shell
Node_groups.set_iam_policysource codeOpen in Cloud Shell
Node_groups.set_node_templatesource codeOpen in Cloud Shell
Node_groups.simulate_maintenance_eventsource codeOpen in Cloud Shell
Node_groups.test_iam_permissionssource codeOpen in Cloud Shell
Node_templates.aggregated_listsource codeOpen in Cloud Shell
Node_templates.deletesource codeOpen in Cloud Shell
Node_templates.getsource codeOpen in Cloud Shell
Node_templates.get_iam_policysource codeOpen in Cloud Shell
Node_templates.insertsource codeOpen in Cloud Shell
Node_templates.listsource codeOpen in Cloud Shell
Node_templates.set_iam_policysource codeOpen in Cloud Shell
Node_templates.test_iam_permissionssource codeOpen in Cloud Shell
Node_types.aggregated_listsource codeOpen in Cloud Shell
Node_types.getsource codeOpen in Cloud Shell
Node_types.listsource codeOpen in Cloud Shell
Packet_mirrorings.aggregated_listsource codeOpen in Cloud Shell
Packet_mirrorings.deletesource codeOpen in Cloud Shell
Packet_mirrorings.getsource codeOpen in Cloud Shell
Packet_mirrorings.insertsource codeOpen in Cloud Shell
Packet_mirrorings.listsource codeOpen in Cloud Shell
Packet_mirrorings.patchsource codeOpen in Cloud Shell
Packet_mirrorings.test_iam_permissionssource codeOpen in Cloud Shell
Projects.disable_xpn_hostsource codeOpen in Cloud Shell
Projects.disable_xpn_resourcesource codeOpen in Cloud Shell
Projects.enable_xpn_hostsource codeOpen in Cloud Shell
Projects.enable_xpn_resourcesource codeOpen in Cloud Shell
Projects.getsource codeOpen in Cloud Shell
Projects.get_xpn_hostsource codeOpen in Cloud Shell
Projects.get_xpn_resourcessource codeOpen in Cloud Shell
Projects.list_xpn_hostssource codeOpen in Cloud Shell
Projects.move_disksource codeOpen in Cloud Shell
Projects.move_instancesource codeOpen in Cloud Shell
Projects.set_common_instance_metadatasource codeOpen in Cloud Shell
Projects.set_default_network_tiersource codeOpen in Cloud Shell
Projects.set_usage_export_bucketsource codeOpen in Cloud Shell
Public_advertised_prefixes.deletesource codeOpen in Cloud Shell
Public_advertised_prefixes.getsource codeOpen in Cloud Shell
Public_advertised_prefixes.insertsource codeOpen in Cloud Shell
Public_advertised_prefixes.listsource codeOpen in Cloud Shell
Public_advertised_prefixes.patchsource codeOpen in Cloud Shell
Public_delegated_prefixes.aggregated_listsource codeOpen in Cloud Shell
Public_delegated_prefixes.deletesource codeOpen in Cloud Shell
Public_delegated_prefixes.getsource codeOpen in Cloud Shell
Public_delegated_prefixes.insertsource codeOpen in Cloud Shell
Public_delegated_prefixes.listsource codeOpen in Cloud Shell
Public_delegated_prefixes.patchsource codeOpen in Cloud Shell
Region_autoscalers.deletesource codeOpen in Cloud Shell
Region_autoscalers.getsource codeOpen in Cloud Shell
Region_autoscalers.insertsource codeOpen in Cloud Shell
Region_autoscalers.listsource codeOpen in Cloud Shell
Region_autoscalers.patchsource codeOpen in Cloud Shell
Region_autoscalers.updatesource codeOpen in Cloud Shell
Region_backend_services.deletesource codeOpen in Cloud Shell
Region_backend_services.getsource codeOpen in Cloud Shell
Region_backend_services.get_healthsource codeOpen in Cloud Shell
Region_backend_services.get_iam_policysource codeOpen in Cloud Shell
Region_backend_services.insertsource codeOpen in Cloud Shell
Region_backend_services.listsource codeOpen in Cloud Shell
Region_backend_services.patchsource codeOpen in Cloud Shell
Region_backend_services.set_iam_policysource codeOpen in Cloud Shell
Region_backend_services.updatesource codeOpen in Cloud Shell
Region_commitments.aggregated_listsource codeOpen in Cloud Shell
Region_commitments.getsource codeOpen in Cloud Shell
Region_commitments.insertsource codeOpen in Cloud Shell
Region_commitments.listsource codeOpen in Cloud Shell
Region_commitments.updatesource codeOpen in Cloud Shell
Region_disk_types.getsource codeOpen in Cloud Shell
Region_disk_types.listsource codeOpen in Cloud Shell
Region_disks.add_resource_policiessource codeOpen in Cloud Shell
Region_disks.create_snapshotsource codeOpen in Cloud Shell
Region_disks.deletesource codeOpen in Cloud Shell
Region_disks.getsource codeOpen in Cloud Shell
Region_disks.get_iam_policysource codeOpen in Cloud Shell
Region_disks.insertsource codeOpen in Cloud Shell
Region_disks.listsource codeOpen in Cloud Shell
Region_disks.remove_resource_policiessource codeOpen in Cloud Shell
Region_disks.resizesource codeOpen in Cloud Shell
Region_disks.set_iam_policysource codeOpen in Cloud Shell
Region_disks.set_labelssource codeOpen in Cloud Shell
Region_disks.test_iam_permissionssource codeOpen in Cloud Shell
Region_disks.updatesource codeOpen in Cloud Shell
Region_health_check_services.deletesource codeOpen in Cloud Shell
Region_health_check_services.getsource codeOpen in Cloud Shell
Region_health_check_services.insertsource codeOpen in Cloud Shell
Region_health_check_services.listsource codeOpen in Cloud Shell
Region_health_check_services.patchsource codeOpen in Cloud Shell
Region_health_checks.deletesource codeOpen in Cloud Shell
Region_health_checks.getsource codeOpen in Cloud Shell
Region_health_checks.insertsource codeOpen in Cloud Shell
Region_health_checks.listsource codeOpen in Cloud Shell
Region_health_checks.patchsource codeOpen in Cloud Shell
Region_health_checks.updatesource codeOpen in Cloud Shell
Region_instance_group_managers.abandon_instancessource codeOpen in Cloud Shell
Region_instance_group_managers.apply_updates_to_instancessource codeOpen in Cloud Shell
Region_instance_group_managers.create_instancessource codeOpen in Cloud Shell
Region_instance_group_managers.deletesource codeOpen in Cloud Shell
Region_instance_group_managers.delete_instancessource codeOpen in Cloud Shell
Region_instance_group_managers.delete_per_instance_configssource codeOpen in Cloud Shell
Region_instance_group_managers.getsource codeOpen in Cloud Shell
Region_instance_group_managers.insertsource codeOpen in Cloud Shell
Region_instance_group_managers.listsource codeOpen in Cloud Shell
Region_instance_group_managers.list_errorssource codeOpen in Cloud Shell
Region_instance_group_managers.list_managed_instancessource codeOpen in Cloud Shell
Region_instance_group_managers.list_per_instance_configssource codeOpen in Cloud Shell
Region_instance_group_managers.patchsource codeOpen in Cloud Shell
Region_instance_group_managers.patch_per_instance_configssource codeOpen in Cloud Shell
Region_instance_group_managers.recreate_instancessource codeOpen in Cloud Shell
Region_instance_group_managers.resizesource codeOpen in Cloud Shell
Region_instance_group_managers.set_instance_templatesource codeOpen in Cloud Shell
Region_instance_group_managers.set_target_poolssource codeOpen in Cloud Shell
Region_instance_group_managers.update_per_instance_configssource codeOpen in Cloud Shell
Region_instance_groups.getsource codeOpen in Cloud Shell
Region_instance_groups.listsource codeOpen in Cloud Shell
Region_instance_groups.list_instancessource codeOpen in Cloud Shell
Region_instance_groups.set_named_portssource codeOpen in Cloud Shell
Region_instance_templates.deletesource codeOpen in Cloud Shell
Region_instance_templates.getsource codeOpen in Cloud Shell
Region_instance_templates.insertsource codeOpen in Cloud Shell
Region_instance_templates.listsource codeOpen in Cloud Shell
Region_instances.bulk_insertsource codeOpen in Cloud Shell
Region_network_endpoint_groups.deletesource codeOpen in Cloud Shell
Region_network_endpoint_groups.getsource codeOpen in Cloud Shell
Region_network_endpoint_groups.insertsource codeOpen in Cloud Shell
Region_network_endpoint_groups.listsource codeOpen in Cloud Shell
Region_network_firewall_policies.add_associationsource codeOpen in Cloud Shell
Region_network_firewall_policies.add_rulesource codeOpen in Cloud Shell
Region_network_firewall_policies.clone_rulessource codeOpen in Cloud Shell
Region_network_firewall_policies.deletesource codeOpen in Cloud Shell
Region_network_firewall_policies.getsource codeOpen in Cloud Shell
Region_network_firewall_policies.get_associationsource codeOpen in Cloud Shell
Region_network_firewall_policies.get_effective_firewallssource codeOpen in Cloud Shell
Region_network_firewall_policies.get_iam_policysource codeOpen in Cloud Shell
Region_network_firewall_policies.get_rulesource codeOpen in Cloud Shell
Region_network_firewall_policies.insertsource codeOpen in Cloud Shell
Region_network_firewall_policies.listsource codeOpen in Cloud Shell
Region_network_firewall_policies.patchsource codeOpen in Cloud Shell
Region_network_firewall_policies.patch_rulesource codeOpen in Cloud Shell
Region_network_firewall_policies.remove_associationsource codeOpen in Cloud Shell
Region_network_firewall_policies.remove_rulesource codeOpen in Cloud Shell
Region_network_firewall_policies.set_iam_policysource codeOpen in Cloud Shell
Region_network_firewall_policies.test_iam_permissionssource codeOpen in Cloud Shell
Region_notification_endpoints.deletesource codeOpen in Cloud Shell
Region_notification_endpoints.getsource codeOpen in Cloud Shell
Region_notification_endpoints.insertsource codeOpen in Cloud Shell
Region_notification_endpoints.listsource codeOpen in Cloud Shell
Region_operations.deletesource codeOpen in Cloud Shell
Region_operations.getsource codeOpen in Cloud Shell
Region_operations.listsource codeOpen in Cloud Shell
Region_operations.waitsource codeOpen in Cloud Shell
Region_security_policies.deletesource codeOpen in Cloud Shell
Region_security_policies.getsource codeOpen in Cloud Shell
Region_security_policies.insertsource codeOpen in Cloud Shell
Region_security_policies.listsource codeOpen in Cloud Shell
Region_security_policies.patchsource codeOpen in Cloud Shell
Region_ssl_certificates.deletesource codeOpen in Cloud Shell
Region_ssl_certificates.getsource codeOpen in Cloud Shell
Region_ssl_certificates.insertsource codeOpen in Cloud Shell
Region_ssl_certificates.listsource codeOpen in Cloud Shell
Region_ssl_policies.deletesource codeOpen in Cloud Shell
Region_ssl_policies.getsource codeOpen in Cloud Shell
Region_ssl_policies.insertsource codeOpen in Cloud Shell
Region_ssl_policies.listsource codeOpen in Cloud Shell
Region_ssl_policies.list_available_featuressource codeOpen in Cloud Shell
Region_ssl_policies.patchsource codeOpen in Cloud Shell
Region_target_http_proxies.deletesource codeOpen in Cloud Shell
Region_target_http_proxies.getsource codeOpen in Cloud Shell
Region_target_http_proxies.insertsource codeOpen in Cloud Shell
Region_target_http_proxies.listsource codeOpen in Cloud Shell
Region_target_http_proxies.set_url_mapsource codeOpen in Cloud Shell
Region_target_https_proxies.deletesource codeOpen in Cloud Shell
Region_target_https_proxies.getsource codeOpen in Cloud Shell
Region_target_https_proxies.insertsource codeOpen in Cloud Shell
Region_target_https_proxies.listsource codeOpen in Cloud Shell
Region_target_https_proxies.patchsource codeOpen in Cloud Shell
Region_target_https_proxies.set_ssl_certificatessource codeOpen in Cloud Shell
Region_target_https_proxies.set_url_mapsource codeOpen in Cloud Shell
Region_target_tcp_proxies.deletesource codeOpen in Cloud Shell
Region_target_tcp_proxies.getsource codeOpen in Cloud Shell
Region_target_tcp_proxies.insertsource codeOpen in Cloud Shell
Region_target_tcp_proxies.listsource codeOpen in Cloud Shell
Region_url_maps.deletesource codeOpen in Cloud Shell
Region_url_maps.getsource codeOpen in Cloud Shell
Region_url_maps.insertsource codeOpen in Cloud Shell
Region_url_maps.listsource codeOpen in Cloud Shell
Region_url_maps.patchsource codeOpen in Cloud Shell
Region_url_maps.updatesource codeOpen in Cloud Shell
Region_url_maps.validatesource codeOpen in Cloud Shell
Regions.getsource codeOpen in Cloud Shell
Regions.listsource codeOpen in Cloud Shell
Reservations.aggregated_listsource codeOpen in Cloud Shell
Reservations.deletesource codeOpen in Cloud Shell
Reservations.getsource codeOpen in Cloud Shell
Reservations.get_iam_policysource codeOpen in Cloud Shell
Reservations.insertsource codeOpen in Cloud Shell
Reservations.listsource codeOpen in Cloud Shell
Reservations.resizesource codeOpen in Cloud Shell
Reservations.set_iam_policysource codeOpen in Cloud Shell
Reservations.test_iam_permissionssource codeOpen in Cloud Shell
Reservations.updatesource codeOpen in Cloud Shell
Resource_policies.aggregated_listsource codeOpen in Cloud Shell
Resource_policies.deletesource codeOpen in Cloud Shell
Resource_policies.getsource codeOpen in Cloud Shell
Resource_policies.get_iam_policysource codeOpen in Cloud Shell
Resource_policies.insertsource codeOpen in Cloud Shell
Resource_policies.listsource codeOpen in Cloud Shell
Resource_policies.set_iam_policysource codeOpen in Cloud Shell
Resource_policies.test_iam_permissionssource codeOpen in Cloud Shell
Routers.aggregated_listsource codeOpen in Cloud Shell
Routers.deletesource codeOpen in Cloud Shell
Routers.getsource codeOpen in Cloud Shell
Routers.get_nat_mapping_infosource codeOpen in Cloud Shell
Routers.get_router_statussource codeOpen in Cloud Shell
Routers.insertsource codeOpen in Cloud Shell
Routers.listsource codeOpen in Cloud Shell
Routers.patchsource codeOpen in Cloud Shell
Routers.previewsource codeOpen in Cloud Shell
Routers.updatesource codeOpen in Cloud Shell
Routes.deletesource codeOpen in Cloud Shell
Routes.getsource codeOpen in Cloud Shell
Routes.insertsource codeOpen in Cloud Shell
Routes.listsource codeOpen in Cloud Shell
Security_policies.add_rulesource codeOpen in Cloud Shell
Security_policies.aggregated_listsource codeOpen in Cloud Shell
Security_policies.deletesource codeOpen in Cloud Shell
Security_policies.getsource codeOpen in Cloud Shell
Security_policies.get_rulesource codeOpen in Cloud Shell
Security_policies.insertsource codeOpen in Cloud Shell
Security_policies.listsource codeOpen in Cloud Shell
Security_policies.list_preconfigured_expression_setssource codeOpen in Cloud Shell
Security_policies.patchsource codeOpen in Cloud Shell
Security_policies.patch_rulesource codeOpen in Cloud Shell
Security_policies.remove_rulesource codeOpen in Cloud Shell
Security_policies.set_labelssource codeOpen in Cloud Shell
Service_attachments.aggregated_listsource codeOpen in Cloud Shell
Service_attachments.deletesource codeOpen in Cloud Shell
Service_attachments.getsource codeOpen in Cloud Shell
Service_attachments.get_iam_policysource codeOpen in Cloud Shell
Service_attachments.insertsource codeOpen in Cloud Shell
Service_attachments.listsource codeOpen in Cloud Shell
Service_attachments.patchsource codeOpen in Cloud Shell
Service_attachments.set_iam_policysource codeOpen in Cloud Shell
Service_attachments.test_iam_permissionssource codeOpen in Cloud Shell
Snapshots.deletesource codeOpen in Cloud Shell
Snapshots.getsource codeOpen in Cloud Shell
Snapshots.get_iam_policysource codeOpen in Cloud Shell
Snapshots.insertsource codeOpen in Cloud Shell
Snapshots.listsource codeOpen in Cloud Shell
Snapshots.set_iam_policysource codeOpen in Cloud Shell
Snapshots.set_labelssource codeOpen in Cloud Shell
Snapshots.test_iam_permissionssource codeOpen in Cloud Shell
Ssl_certificates.aggregated_listsource codeOpen in Cloud Shell
Ssl_certificates.deletesource codeOpen in Cloud Shell
Ssl_certificates.getsource codeOpen in Cloud Shell
Ssl_certificates.insertsource codeOpen in Cloud Shell
Ssl_certificates.listsource codeOpen in Cloud Shell
Ssl_policies.aggregated_listsource codeOpen in Cloud Shell
Ssl_policies.deletesource codeOpen in Cloud Shell
Ssl_policies.getsource codeOpen in Cloud Shell
Ssl_policies.insertsource codeOpen in Cloud Shell
Ssl_policies.listsource codeOpen in Cloud Shell
Ssl_policies.list_available_featuressource codeOpen in Cloud Shell
Ssl_policies.patchsource codeOpen in Cloud Shell
Subnetworks.aggregated_listsource codeOpen in Cloud Shell
Subnetworks.deletesource codeOpen in Cloud Shell
Subnetworks.expand_ip_cidr_rangesource codeOpen in Cloud Shell
Subnetworks.getsource codeOpen in Cloud Shell
Subnetworks.get_iam_policysource codeOpen in Cloud Shell
Subnetworks.insertsource codeOpen in Cloud Shell
Subnetworks.listsource codeOpen in Cloud Shell
Subnetworks.list_usablesource codeOpen in Cloud Shell
Subnetworks.patchsource codeOpen in Cloud Shell
Subnetworks.set_iam_policysource codeOpen in Cloud Shell
Subnetworks.set_private_ip_google_accesssource codeOpen in Cloud Shell
Subnetworks.test_iam_permissionssource codeOpen in Cloud Shell
Target_grpc_proxies.deletesource codeOpen in Cloud Shell
Target_grpc_proxies.getsource codeOpen in Cloud Shell
Target_grpc_proxies.insertsource codeOpen in Cloud Shell
Target_grpc_proxies.listsource codeOpen in Cloud Shell
Target_grpc_proxies.patchsource codeOpen in Cloud Shell
Target_http_proxies.aggregated_listsource codeOpen in Cloud Shell
Target_http_proxies.deletesource codeOpen in Cloud Shell
Target_http_proxies.getsource codeOpen in Cloud Shell
Target_http_proxies.insertsource codeOpen in Cloud Shell
Target_http_proxies.listsource codeOpen in Cloud Shell
Target_http_proxies.patchsource codeOpen in Cloud Shell
Target_http_proxies.set_url_mapsource codeOpen in Cloud Shell
Target_https_proxies.aggregated_listsource codeOpen in Cloud Shell
Target_https_proxies.deletesource codeOpen in Cloud Shell
Target_https_proxies.getsource codeOpen in Cloud Shell
Target_https_proxies.insertsource codeOpen in Cloud Shell
Target_https_proxies.listsource codeOpen in Cloud Shell
Target_https_proxies.patchsource codeOpen in Cloud Shell
Target_https_proxies.set_certificate_mapsource codeOpen in Cloud Shell
Target_https_proxies.set_quic_overridesource codeOpen in Cloud Shell
Target_https_proxies.set_ssl_certificatessource codeOpen in Cloud Shell
Target_https_proxies.set_ssl_policysource codeOpen in Cloud Shell
Target_https_proxies.set_url_mapsource codeOpen in Cloud Shell
Target_instances.aggregated_listsource codeOpen in Cloud Shell
Target_instances.deletesource codeOpen in Cloud Shell
Target_instances.getsource codeOpen in Cloud Shell
Target_instances.insertsource codeOpen in Cloud Shell
Target_instances.listsource codeOpen in Cloud Shell
Target_pools.add_health_checksource codeOpen in Cloud Shell
Target_pools.add_instancesource codeOpen in Cloud Shell
Target_pools.aggregated_listsource codeOpen in Cloud Shell
Target_pools.deletesource codeOpen in Cloud Shell
Target_pools.getsource codeOpen in Cloud Shell
Target_pools.get_healthsource codeOpen in Cloud Shell
Target_pools.insertsource codeOpen in Cloud Shell
Target_pools.listsource codeOpen in Cloud Shell
Target_pools.remove_health_checksource codeOpen in Cloud Shell
Target_pools.remove_instancesource codeOpen in Cloud Shell
Target_pools.set_backupsource codeOpen in Cloud Shell
Target_ssl_proxies.deletesource codeOpen in Cloud Shell
Target_ssl_proxies.getsource codeOpen in Cloud Shell
Target_ssl_proxies.insertsource codeOpen in Cloud Shell
Target_ssl_proxies.listsource codeOpen in Cloud Shell
Target_ssl_proxies.set_backend_servicesource codeOpen in Cloud Shell
Target_ssl_proxies.set_certificate_mapsource codeOpen in Cloud Shell
Target_ssl_proxies.set_proxy_headersource codeOpen in Cloud Shell
Target_ssl_proxies.set_ssl_certificatessource codeOpen in Cloud Shell
Target_ssl_proxies.set_ssl_policysource codeOpen in Cloud Shell
Target_tcp_proxies.aggregated_listsource codeOpen in Cloud Shell
Target_tcp_proxies.deletesource codeOpen in Cloud Shell
Target_tcp_proxies.getsource codeOpen in Cloud Shell
Target_tcp_proxies.insertsource codeOpen in Cloud Shell
Target_tcp_proxies.listsource codeOpen in Cloud Shell
Target_tcp_proxies.set_backend_servicesource codeOpen in Cloud Shell
Target_tcp_proxies.set_proxy_headersource codeOpen in Cloud Shell
Target_vpn_gateways.aggregated_listsource codeOpen in Cloud Shell
Target_vpn_gateways.deletesource codeOpen in Cloud Shell
Target_vpn_gateways.getsource codeOpen in Cloud Shell
Target_vpn_gateways.insertsource codeOpen in Cloud Shell
Target_vpn_gateways.listsource codeOpen in Cloud Shell
Target_vpn_gateways.set_labelssource codeOpen in Cloud Shell
Url_maps.aggregated_listsource codeOpen in Cloud Shell
Url_maps.deletesource codeOpen in Cloud Shell
Url_maps.getsource codeOpen in Cloud Shell
Url_maps.insertsource codeOpen in Cloud Shell
Url_maps.invalidate_cachesource codeOpen in Cloud Shell
Url_maps.listsource codeOpen in Cloud Shell
Url_maps.patchsource codeOpen in Cloud Shell
Url_maps.updatesource codeOpen in Cloud Shell
Url_maps.validatesource codeOpen in Cloud Shell
Vpn_gateways.aggregated_listsource codeOpen in Cloud Shell
Vpn_gateways.deletesource codeOpen in Cloud Shell
Vpn_gateways.getsource codeOpen in Cloud Shell
Vpn_gateways.get_statussource codeOpen in Cloud Shell
Vpn_gateways.insertsource codeOpen in Cloud Shell
Vpn_gateways.listsource codeOpen in Cloud Shell
Vpn_gateways.set_labelssource codeOpen in Cloud Shell
Vpn_gateways.test_iam_permissionssource codeOpen in Cloud Shell
Vpn_tunnels.aggregated_listsource codeOpen in Cloud Shell
Vpn_tunnels.deletesource codeOpen in Cloud Shell
Vpn_tunnels.getsource codeOpen in Cloud Shell
Vpn_tunnels.insertsource codeOpen in Cloud Shell
Vpn_tunnels.listsource codeOpen in Cloud Shell
Vpn_tunnels.set_labelssource codeOpen in Cloud Shell
Zone_operations.deletesource codeOpen in Cloud Shell
Zone_operations.getsource codeOpen in Cloud Shell
Zone_operations.listsource codeOpen in Cloud Shell
Zone_operations.waitsource codeOpen in Cloud Shell
Zones.getsource codeOpen in Cloud Shell
Zones.listsource codeOpen in Cloud Shell
Addresses.aggregated_listsource codeOpen in Cloud Shell
Addresses.deletesource codeOpen in Cloud Shell
Addresses.insertsource codeOpen in Cloud Shell
Addresses.listsource codeOpen in Cloud Shell
Region_operations.getsource codeOpen in Cloud Shell
Region_operations.waitsource codeOpen in Cloud Shell
Quickstartsource codeOpen in Cloud Shell
Quickstart.testsource codeOpen in Cloud Shell

The Google Compute Engine Node.js Client API Reference documentation also contains samples.

Supported Node.js Versions

Our client libraries follow the Node.js release schedule. Libraries are compatible with all current active and maintenance versions of Node.js. If you are using an end-of-life version of Node.js, we recommend that you update as soon as possible to an actively supported LTS version.

Google's client libraries support legacy versions of Node.js runtimes on a best-efforts basis with the following warnings:

  • Legacy versions are not tested in continuous integration.
  • Some security patches and features cannot be backported.
  • Dependencies cannot be kept up-to-date.

Client libraries targeting some end-of-life versions of Node.js are available, and can be installed through npm dist-tags. The dist-tags follow the naming convention legacy-(version). For example, npm install @google-cloud/compute@legacy-8 installs client libraries for versions compatible with Node.js 8.

Versioning

This library follows Semantic Versioning.

This library is considered to be stable. The code surface will not change in backwards-incompatible ways unless absolutely necessary (e.g. because of critical security issues) or with an extensive deprecation period. Issues and requests against stable libraries are addressed with the highest priority.

More Information: Google Cloud Platform Launch Stages

Contributing

Contributions welcome! See the Contributing Guide.

Please note that this README.md, the samples/README.md, and a variety of configuration files in this repository (including .nycrc and tsconfig.json) are generated from a central template. To edit one of these files, make an edit to its templates in directory.

License

Apache Version 2.0

See LICENSE