NOTE: Some aspects of this product are in Beta. The hybrid installation options are GA. To join the Beta program, reach out to your Apigee representative.

Getting started using gcloud with Apigee

The gcloud alpha apigee CLI enables you to perform the following tasks:

  • View API proxies
  • Create and manage API products
  • Deploy and undeploy API proxies, and view deployment details
  • View information about developers and apps
  • List your environments and organizations

The following sections describe how to install, authorize, and use the gcloud alpha apigee CLI, and optionally set environment variables.

Before you begin

Ensure that you have met the prerequisites for using Apigee, including installing the Google Cloud SDK.

Installing the gcloud alpha apigee component

To access the gcloud alpha apigee commands, you must install the complete gcloud alpha component, as follows:

gcloud components install alpha

To confirm that the alpha component has been installed, enter the following command:

gcloud components list

You should see the alpha component in the list, as follows:

Status Name ID Size
Installed gcloud Alpha Commands alpha < 1 MiB

For more information, see Managing SDK components.

Authorizing access to gcloud

Authorize access to the gloud CLI by following the steps described in Authorizing Cloud SDK tools.

For example, to authorizes access using your user account and perform other common Cloud SDK setup steps, use the following command:

gcloud init

Follow the prompts to authenticate the account, grant access permissions, and initialize your Cloud SDK installation, as described in Initializing Cloud SDK.

Alternatively, to authorize access without performing any additional set up, use the following command:

gcloud auth login

Follow the browser-based authorization flow to authenticate the account and grant access permissions.

For more information about authorizing and revoking access to the gcloud CLI, see Credentials.

Setting environment variables for gcloud commands

The Apigee API and gcloud CLI examples provided throughout the documentation use one or more of the environment variables defined in the following table.

By setting the environment variables upfront to meaningful values in your environment, you can copy and paste the example requests to execute them in your own environment with minimal or no modifications.

Environment variable Description
$API Name of your API proxy.
$ENV Name of your environment, such as test or prod.
$ORG Your Apigee organization.
$APP ID of an app.
$REV Revision number of your API proxy.

Using gcloud alpha apigee

Use the gcloud alpha apigee CLI as follows:

gcloud alpha apigee GROUP [GCLOUD_WIDE_FLAG …]

For more information about the available command groups and flags, see gcloud alpha apigee.

For example, the following command lists the API proxies in your organization:

gcloud alpha apigee apis list --organization=$ORG

The following provides an example of the response for the my-org organization:

Using Apigee organization `myorg`
 - hello-world
 - weather-app
 

More information

For more information, see: