Gcloud

Let's go through a few commands to get a feel for the syntax of the gcloud CLI:

  • To list all your projects, use:
$ gcloud projects list
  • To list all your instances in the packt-gcp project, use:
$ gcloud compute instances list --project packt-gcp

The global generic syntax of the gcloud that also applies the other CLI tools is:

$ gcloud GROUP | COMMAND parameters

Where GROUP is a service or an account element and COMMAND is the command to send to the GROUP. For instance in gcloud projects list, projects is the GROUP, an element of your account and list is the COMMAND. In gcloud compute instances list --project packt-gcp, the GROUP is compute, followed by a sub-group instances, and the COMMAND is list while --project packt-gcp are ...

Get Hands-On Machine Learning on Google Cloud Platform now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.