View quotas using the gcloud alpha CLI

The following sections contain example gcloud alpha quotas info and gcloud alpha quotas preferences commands. These commands allow you to view and manage QuotaInfo and QuotaPreference resources.

You can use the Google Cloud CLI (gcloud CLI) to get current quotas values and specify quota preferences for some Google Cloud APIs and services.

Limitations

Cloud Quotas has the following limitations:

  • All quota increase adjustments are subject to Google Cloud approval.

  • You can request both quota increase and decrease adjustments for project-level quotas.

  • You can request quota decrease adjustments for project-, folder-, and organization-level quotas.

Before you begin

Before you begin, make sure that you install and initialize the gcloud CLI.

You may also need your QUOTA_ID value. If so, see the instructions for finding your QUOTA_ID.

Install and initialize the gcloud CLI

To use the gcloud CLI, make sure you have installed and initialized the latest version of the gcloud CLI, including the alpha commands component. If you're using Cloud Shell to interact with Google Cloud, the gcloud CLI is installed for you.

Find your quota ID

Many of the gcloud CLI commands on this page refer to your quota ID value.

To find the quota ID value, use the following gcloud CLI command to list your quota information for the specified service:

  1. Enter the following gcloud CLI command in a terminal window:

    gcloud alpha quotas info list --service=SERVICE_NAME --project=PROJECT_ID_OR_NUMBER
    

    Replace the following:

    • SERVICE_NAME: the service name with quotas that you want to see—for example, the service name for Cloud Logging is logging.googleapis.com

    • PROJECT_ID_OR_NUMBER: the project ID or project number

      To find your project ID using the Google Cloud console, navigate to the Resource Manager page:

      Go to Resource Manager

  2. The output from the gcloud alpha quotas info list command contains text similar to the following sample:

    ...
    "quotaInfos": [
         ...
         {
            "name": "projects/PROJECT_NUMBER/locations/global/services/compute.googleapis.com/quotaInfos/CPUS-per-project-region",
            "quotaId": "CPUS-per-project-region",
            "metric": "compute.googleapis.com/cpus",
            "containerType": "PROJECT",
            "dimensions": [
                "region"
            ],
            "dimensionsInfo": [
                {
                    "details": {
                        "value": 20
                    },
                    "applicableLocations": [
                        "us-central1",
                        "us-central2",
                        "us-west1",
                        "us-east1"
                    ]
                    ...
                }
            ]
        },
        ...
    ]
    ...
    
  3. Look for the value that corresponds to quotaId and use it when specifying QUOTA_ID in the following sections.

Example gcloud quota information commands

This section provides examples that show how to use gcloud alpha quotas info commands to view quota information for a particular service or for an organization.

QuotaInfo is a read-only resource that provides metadata and quota value information about a particular quota for a given project, folder or organization.

View quota information for a particular service

To view quota information for a particular service, run the following command:

gcloud alpha quotas info describe QUOTA_ID --service=SERVICE_NAME \
    --project=PROJECT_ID_OR_NUMBER

Replace the following:

  • QUOTA_ID: the ID of the quota
  • SERVICE_NAME: the service name with quotas that you want to see—for example, the service name for Cloud Logging is logging.googleapis.com
  • PROJECT_ID_OR_NUMBER: the project ID or project number

View quota information for an organization

To view the same service's quota details for an organization, run the following command:

gcloud alpha quotas info list --service=SERVICE_NAME --organization=ORGANIZATION_ID

Replace the following:

  • SERVICE_NAME: the service name with quotas that you want to see—for example, the service name for Cloud Logging is logging.googleapis.com
  • ORGANIZATION_ID: the ID of your organization

Example gcloud quota preferences commands

This section provides examples that show how to use gcloud alpha quotas preferences commands to check existing quota preferences and adjust the quota value.

The QuotaPreference resource represents your preference for a particular dimension combination. A dimension is an attribute that represents a region or a zone, or a service-specific dimension, such as gpu_family or network_id.

Check for existing preferences

To check for existing preferences, run the following command:

gcloud alpha quotas preferences list --project=PROJECT_ID_OR_NUMBER

Replace PROJECT_ID_OR_NUMBER with the project ID or project number.

Check for existing preferences with pending quota adjustments

To check for existing preferences with pending quota adjustments, add the --reconciling-only=true flag as shown in the following command:

gcloud alpha quotas preferences list --project=PROJECT_ID_OR_NUMBER --reconciling-only=true

Replace PROJECT_ID_OR_NUMBER with the project ID or project number.

Request a quota increase adjustment for a specific region when a quota preference hasn't been set

To request a quota increase adjustment for a specific region when a preference hasn't yet been set, run the following command:

gcloud alpha quotas preferences create --preferred-value=PREFERRED_VALUE \
    --quota-id=QUOTA_ID --service=SERVICE_NAME \
    --project=PROJECT_ID_OR_NUMBER --preference-id=PREFERENCE_ID

Replace the following:

  • PREFERRED_VALUE: the preferred quota value
  • QUOTA_ID: the ID of the quota
  • SERVICE_NAME: the service name with quotas that you want to see—for example, the service name for Cloud Logging is logging.googleapis.com
  • PROJECT_ID_OR_NUMBER: the project ID or project number
  • PREFERENCE_ID: the preference ID

Request a quota increase adjustment for a specific region when a quota preference has been set

To request a quota increase adjustment for a specific region and there is already a preference, rerun the following command:

gcloud alpha quotas preferences update PREFERENCE_ID --preferred-value=PREFERRED_VALUE \
    --quota-id=QUOTA_ID --service=SERVICE_NAME--project=PROJECT_ID_OR_NUMBER

Replace the following:

  • PREFERENCE_ID: the preference ID
  • PREFERRED_VALUE</var>"}}: the preferred quota value
  • QUOTA_ID: the ID of the quota
  • SERVICE_NAME: the service name with quotas that you want to see—for example, the service name for Cloud Logging is logging.googleapis.com
  • PROJECT_ID_OR_NUMBER: the project ID or project number

Retrieve an existing quota preference

To retrieve an existing quota preference, run the following command:

gcloud alpha quotas preferences describe PREFERENCE_ID project=PROJECT_ID_OR_NUMBER

Replace the following:

  • PREFERENCE_ID: the preference ID
  • PROJECT_ID_OR_NUMBER: the project ID or project number

Other services with quota-related gcloud CLI commands

In addition to gcloud alpha quotas, some services have their own command-line access to quota and resource usage information.

For example, Compute Engine lets you access quota information. For details, see the following Compute Engine sections:

What's next

For a complete list of gcloud alpha quotas commands and flags, see the gcloud alpha quotas section of the Google Cloud CLI reference.

For more information about quotas terminology, see Understand quota values and system limits.