To view a summary of VMs running in your project, get a list of VMs. This document shows you how to get a list of VMs in all zones or in specific zones.
ConsoleIn the Google Cloud console, go to the VM instances page:
gcloudGet an aggregate list of all VMs in all zones for a project by using the gcloud compute instances list
command:
gcloud compute instances list
To narrow the list of VMs to a specific zone, use the previous command with the --zones
flag.
The following example get a list of instances across all zones in your project:
Before trying this sample, follow the Go setup instructions in the Compute Engine quickstart using client libraries. For more information, see the Compute Engine Go API reference documentation.
To authenticate to Compute Engine, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
You can also get a list instances in a specific zone:
JavaThe following example get a list of instances across all zones in your project:
Before trying this sample, follow the Java setup instructions in the Compute Engine quickstart using client libraries. For more information, see the Compute Engine Java API reference documentation.
To authenticate to Compute Engine, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
You can also get a list instances in a specific zone:
Node.jsThe following example get a list of instances across all zones in your project:
Before trying this sample, follow the Node.js setup instructions in the Compute Engine quickstart using client libraries. For more information, see the Compute Engine Node.js API reference documentation.
To authenticate to Compute Engine, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
You can also get a list instances in a specific zone:
PythonThe following example get a list of instances across all zones in your project:
Before trying this sample, follow the Python setup instructions in the Compute Engine quickstart using client libraries. For more information, see the Compute Engine Python API reference documentation.
To authenticate to Compute Engine, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
You can also get a list instances in a specific zone:
RESTGet an aggregate list of all VMs in all zones in a project by using the instances.aggregatedList
method:
GET https://compute.googleapis.com/compute/v1/projects/PROJECT/aggregated/instances
Replace PROJECT
with the name of the project to get a list of VMs from.
To narrow the list of VMs to a specific zone, use the instances.list
method:
GET https://compute.googleapis.com/compute/v1/projects/PROJECT/zones/ZONE/instances
Replace the following:
PROJECT
: the name of the project to get a list of VMs from
ZONE
: the zone to get a list of VMs from
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4