Use the Compute Engine alpha API

This document explains how to enable your project to send HTTP requests to alpha Compute Engine API URIs. If you're new to the Compute Engine API, then see Prerequisites.

By default, your project can't send HTTP requests to the following alpha Compute Engine API URI:

https://compute.googleapis.com/compute/alpha/...

Google Cloud manages access to alpha URIs for specific Compute Engine features. You must first allow your organization, folder, or project to access and use alpha features. After this step, you can view which features are available, and then enable a project to send HTTP requests to their alpha URIs. Use Compute Engine alpha features to test and develop with early-stage features before they're available in Preview.

Before you begin

  • You can only enable a project to send HTTP requests to an alpha URI if the project is part of an organization. If not, then migrate the project to an organization.
  • If you haven't already, set up authentication. Authentication verifies your identity for access to Google Cloud services and APIs. To run code or samples from a local development environment, you can authenticate to Compute Engine by selecting one of the following options:

    Select the tab for how you plan to use the samples on this page:

    Console

    When you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.

    gcloud

    1. Install the Google Cloud CLI, and then sign in to the gcloud CLI with your federated identity. After signing in, initialize the Google Cloud CLI by running the following command:

      gcloud init
    2. Set a default region and zone.

    Terraform

    To use the Terraform samples on this page in a local development environment, install and initialize the gcloud CLI, and then set up Application Default Credentials with your user credentials.

    1. Install the Google Cloud CLI.

  • Configure the gcloud CLI to use your federated identity.

    For more information, see Sign in to the gcloud CLI with your federated identity.

  • Create local authentication credentials for your user account:

    gcloud auth application-default login

    If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.

  • For more information, see Set up authentication for a local development environment.