This page describes how to get started using the Google Cloud CLI, so you can use it to manage Cloud Composer environments.
In addition to using the Cloud Composer APIs,
you can manage and access Cloud Composer environments
using Google Cloud CLI gcloud composer
commands.
The Google Cloud CLI provides the gcloud
command-line tool to interact
with Cloud Composer and other Google Cloud services.
Before you begin
- The
gcloud
tool uses the API to access Cloud Composer, so you must enable the API before you can use thegcloud
command-line tool to access Cloud Composer.
Enable the Cloud Composer API - Install the Google Cloud CLI on your local client.
Getting started with the gcloud command-line tool
To start with the gcloud
tool, review the
Google Cloud CLI Documentation. You can get help for the tool, resources, and commands by using the --help
flag:
gcloud composer environments --help
The help displayed with the --help
flag is also available in the Google Cloud CLI
reference for gcloud composer
.
Setting the default project and location in your local client
Most gcloud composer
commands require a location. You can specify the
location by using the --location
flag or by setting the default location.
To set the default project and location for Cloud Composer:
- To set the default project, enter the following command:
gcloud config set project PROJECT_ID
where PROJECT_ID is the ID of the Google Cloud project that the Cloud Composer environment belongs to.
- To configure the Cloud Composer location, enter the following command:
gcloud config set composer/location LOCATION
where LOCATION is a supported region such as
us-central1
oreurope-west1
. - (Optional) To list the configuration for the
gcloud
tool, enter the following command:gcloud config list