gcloud sdk
Interacting with google cloud platform services with gcloud cli tool
Google Cloud Platform(GCP) has a command line interface tool for interacting with its underlying API system. It is called gcloud. Documentation and installation instructions can be found here – https://cloud.google.com/sdk/docs/
You can view the version number –
daniel@hidmo:/tmp$ gcloud version Google Cloud SDK 263.0.0 beta 2019.05.17 bq 2.0.47 core 2019.09.13 gsutil 4.42 kubectl 2019.08.23
You can create a compute instance by specifying the zonal location, machine type, network, image type and additional parameters such as preemption and enabling serial port.
gcloud compute instances create webserver --zone us-east1-c --can-ip-forward --machine-type=f1-micro --preemptible --metadata=serial-port-enable=1 --network=default --tags=ubuntu --no-address --image-family=ubuntu-1804-lts --image-project=ubuntu-os-cloud --project gcp-project-id
With gcloud version 263 and after, the gcloud help command shows the subcommands layed out by the GCP products and services and a brief description of each subcommand –
Available commands for gcloud: AI and Machine Learning ai-platform Manage AI Platform jobs and models. ml Use Google Cloud machine learning capabilities. ml-engine Manage AI Platform jobs and models. API Platform and Ecosystems endpoints Create, enable and manage API services. service-management Create, enable and manage API services. services List, enable and disable APIs and services. Compute app Manage your App Engine deployments. compute Create and manipulate Google Compute Engine resources. container Deploy and manage clusters of machines for running containers. functions Manage Google Cloud Functions. Data Analytics composer Create and manage Cloud Composer Environments. dataflow Manage Google Cloud Dataflow resources. dataproc Create and manage Google Cloud Dataproc clusters and jobs. pubsub Manage Cloud Pub/Sub topics, subscriptions, and snapshots. Databases bigtable Manage your Cloud Bigtable storage. datastore Manage your Cloud Datastore indexes. spanner Command groups for Cloud Spanner. sql Create and manage Google Cloud SQL databases. Identity and Security access-context-manager Manage Access Context Manager resources. auth Manage oauth2 credentials for the Google Cloud SDK. iam Manage IAM service accounts and keys. kms Manage cryptographic keys in the cloud. Internet of Things iot Manage Cloud IoT resources. Management Tools builds Create and manage builds for Google Cloud Build. debug Commands for interacting with the Cloud Debugger. deployment-manager Manage deployments of cloud resources. logging Manage Stackdriver Logging. organizations Create and manage Google Cloud Platform Organizations. projects Create and manage project access policies. Mobile firebase Work with Google Firebase. Networking dns Manage your Cloud DNS managed-zones and record-sets. domains Manage domains for your Google Cloud projects. SDK Tools alpha Alpha versions of gcloud commands. beta Beta versions of gcloud commands. components List, install, update, or remove Google Cloud SDK components. config View and edit Cloud SDK properties. feedback Provide feedback to the Google Cloud SDK team. help Search gcloud help text. info Display information about the current gcloud environment. init Initialize or reinitialize gcloud. meta Cloud meta introspection commands. source Cloud git repository commands. topic gcloud supplementary help. version Print version information for Cloud SDK components. Storage filestore Create and manipulate Cloud Filestore resources. redis Manage Cloud Memorystore Redis resources.
References –