Use the Compute Engine alpha API Stay organized with collections Save and categorize content based on your preferences.
This document explains how to enable your project to send HTTP requests to alphaCompute Engine API URIs. If you're new to the Compute Engine API, then seePrerequisites.
By default, your project can't send HTTP requests to the following alphaCompute Engine API URI:
https://compute.googleapis.com/compute/alpha/...Google Cloud manages access to alpha URIs for specific Compute Enginefeatures. You must first allow your organization, folder, or project to accessand use alpha features. After this step, you can view which features areavailable, and then enable a project to send HTTP requests to their alpha URIs.Use Compute Engine alpha features to test and develop with early-stagefeatures before they're available inPreview.
Caution: Compute Engine alpha features are experimental. Using themmight result in breaking changes. For more information, see thePre-GA offering service terms.Before you begin
- You can only enable a project to send HTTP requests to an alpha URI if theproject is part of an organization. If not, thenmigrate the project to anorganization.
- If you haven't already, set upauthentication. 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
Install the Google Cloud CLI. After installation,initialize the Google Cloud CLI by running the following command:
gcloudinit
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update.- 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.
Install the Google Cloud CLI.
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update.If you're using a local shell, then create local authentication credentials for your user account:
gcloudauthapplication-defaultlogin
You don't need to do this if you're using Cloud Shell.
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.
REST
To use the REST API samples on this page in a local development environment, you use the credentials you provide to the gcloud CLI.
Install the Google Cloud CLI.
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update.For more information, seeAuthenticate for using REST in the Google Cloud authentication documentation.
Required roles
To get the permissions that you need to enable or disable projects to send HTTP requests to alpha Compute Engine API URIs, ask your administrator to grant you the following IAM roles:
- To enable an organization policy:Organization Policy Administrator (
roles/orgpolicy.policyAdmin) on the organization - To view, enable, or disable alpha features:Compute Admin (
roles/compute.admin) on the project
For more information about granting roles, seeManage access to projects, folders, and organizations.
These predefined roles contain the permissions required to enable or disable projects to send HTTP requests to alpha Compute Engine API URIs. To see the exact permissions that are required, expand theRequired permissions section:
Required permissions
The following permissions are required to enable or disable projects to send HTTP requests to alpha Compute Engine API URIs:
- To edit organization policies:
orgpolicy.policy.seton the organization, folder, or project - To enable or disable access to an alpha Compute Engine API URI for a project:
compute.previewFeatures.updateon the project - To view available alpha features:
compute.previewFeatures.geton the project
You might also be able to get these permissions withcustom roles or otherpredefined roles.
Allow access to alpha features
Before you can use Compute Engine alpha features with REST, you mustenable theBlock Compute Engine preview features(compute.managed.blockPreviewFeatures) policy in your organization, folder, orproject. This policy change allows your project, or the projects within yourorganization or folder, to access and use alpha features.
To allow your organization, folder, or project to access alpha features withREST, select one of the following options:
Console
In the Google Cloud console, go to theOrganization policies page.
If you haven't already, from the project picker, select theorganization, folder, or project where you want to edit the policy.
In theName column, clickBlock Compute Engine preview features. ThePolicy details page appears.
ClickManage policy. TheEdit policy page appears.
In thePolicy source section, selectOverride parent's policy.
In theRules section, clickAdd rule, and then do the following:
In theEnforcement section, selectOn.
In the row containing theallowedPreviewFeatures parameter,clickEdit. TheEdit parameter values pane appears.
In theValue type section, selectUser-defined.
In theUser-defined values section, enter
alpha-api-access.ClickSave.
ClickSet policy. Then, in the dialog that appears, clickSet policy again.
The policy change can take up to 15 minutes to propagate.
gcloud
To download the
compute.managed.blockPreviewFeaturespolicy as a filenamedpolicy.yaml, use thegcloud org-policies describecommandwith one of the following flags:To enable the policy in your organization, include the
--organizationflag:gcloud org-policies describe compute.managed.blockPreviewFeatures --organization=ORGANIZATION_ID > policy.yamlTo enable the policy in your folder, include the
--folderflag:gcloud org-policies describe compute.managed.blockPreviewFeatures --folder=FOLDER_ID > policy.yamlTo enable the policy in your project, include the
--projectflag:gcloud org-policies describe compute.managed.blockPreviewFeatures --project=PROJECT_ID > policy.yaml
Replace the following:
ORGANIZATION_ID: theID of your organizationFOLDER_ID: theID of your folderPROJECT_ID: the ID of your project
Open the
policy.yamlfile using a text editor. In the file, after therulesfield, add theenforcefield set totrue. For example, ifyou're enabling the policy in your organization, yourpolicy.yamlentry is as follows:name:organizations/ORGANIZATION_ID/policies/compute.managed.blockPreviewFeaturesspec:rules:-enforce:trueSave the
policy.yamlfile, and then close the text editor.To update the policy for your organization, folder, or project, use the
gcloud org-policies set-policycommand:gcloud org-policies set-policy policy.yamlOptional: To delete the
policy.yamlfile, do one of the following:If you're using the Linux or macOS terminal, then use the followingcommand:
rm policy.yamlIf you're using the Windows terminal, then use the followingcommand:
del policy.yaml
The policy change can take up to 15 minutes to propagate.
For more information about managing organization policies, seeUsing constraintsin the Resource Manager documentation.
Use alpha features in your project
After you allow your organization, folder, or project access toCompute Engine alpha features, you can enable a project to use thosefeatures by completing the following steps:
View available alpha features
To view which Compute Engine features are available in alpha, select oneof the following options:
Console
In the Google Cloud console, go to thePreview features page.
In the table that appears, you can view a list of available alpha features.
gcloud
To view the Compute Engine features available in alpha, use thegcloud compute preview-features list command.
Execute the following command:
Linux, macOS, or Cloud Shell
gcloudcomputepreview-featureslist
Windows (PowerShell)
gcloudcomputepreview-featureslist
Windows (cmd.exe)
gcloudcomputepreview-featureslist
You should receive a response similar to the following:
NAME STATUSalpha-feature-1 DISABLEDalpha-feature-2 DISABLED
REST
To view the Compute Engine features available in alpha, make aGETrequest to thepreviewFeatures.list method.
Before using any of the request data, make the following replacements:
- PROJECT_ID: the ID of your project
HTTP method and URL:
GET https://compute.googleapis.com/compute/projects/PROJECT_ID/global/previewFeatures
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list.Execute the following command:
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://compute.googleapis.com/compute/projects/PROJECT_ID/global/previewFeatures"
PowerShell (Windows)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list.Execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://compute.googleapis.com/compute/projects/PROJECT_ID/global/previewFeatures" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "previewFeatures": [ { "activationStatus": "DISABLED", "creationTimestamp": "2025-03-01T00:00:00Z", "description": "Please see status.description for details.", "id": "560966157", "name": "alphaFeature1", "status": { "description": "Enables access to alpha APIs.", "helpLink": "some-link", "releaseStatus": { "stage": "GA", "updateDate": { "day": 1, "month": 3, "year": 2025 } } } }, ... ]}Enable an alpha feature
To enable your project to send HTTP requests to the alpha URI of aCompute Engine feature, select one of the following options:
Console
In the Google Cloud console, go to thePreview features page.
ClickEnable next to the preview feature you want to enable. Then, in the dialog that appears, clickEnable again.
gcloud
To enable your project to send HTTP requests to the alpha URI of aCompute Engine feature, use thegcloud compute preview-features update commandwith the--activation-status flag set toenabled.
Before using any of the command data below, make the following replacements:
- FEATURE_NAME: the name of the feature that you want to start using.
Execute the following command:
Linux, macOS, or Cloud Shell
gcloudcomputepreview-featuresupdateFEATURE_NAME\--activation-status=enabled\--rollout-plan=fast-rollout
Windows (PowerShell)
gcloudcomputepreview-featuresupdateFEATURE_NAME`--activation-status=enabled`--rollout-plan=fast-rollout
Windows (cmd.exe)
gcloudcomputepreview-featuresupdateFEATURE_NAME^--activation-status=enabled^--rollout-plan=fast-rollout
You should receive a response similar to the following:
status: DONE
REST
To enable your project to send HTTP requests to the alpha URI of aCompute Engine feature, make aPATCH request to thepreviewFeatures.update method.
Before using any of the request data, make the following replacements:
- PROJECT_ID: the ID of your project.
- FEATURE_NAME: the name of the feature that you want to start using.
HTTP method and URL:
PATCH https://compute.googleapis.com/compute/projects/PROJECT_ID/global/previewFeatures/FEATURE_NAME
Request JSON body:
{ "activationStatus": "ENABLED", "rolloutOperation": { "rolloutInput": { "predefinedRolloutPlan": "ROLLOUT_PLAN_FAST_ROLLOUT" } }}To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list. Save the request body in a file namedrequest.json, and execute the following command:
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://compute.googleapis.com/compute/projects/PROJECT_ID/global/previewFeatures/FEATURE_NAME"
PowerShell (Windows)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list. Save the request body in a file namedrequest.json, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://compute.googleapis.com/compute/projects/PROJECT_ID/global/previewFeatures/FEATURE_NAME" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "kind": "compute#operation", "status": "DONE"}Terraform
To enable your project to send HTTP requests to the alpha URI of aCompute Engine feature, use thegoogle_compute_preview_feature Terraform resource.
For example, to enable access to all Compute Engine alpha features,use the following resource:
resource "google_compute_preview_feature" "default" { name = "alpha-api-access" activation_status = "ENABLED" rollout_operation { rollout_input { predefined_rollout_plan = "ROLLOUT_PLAN_FAST_ROLLOUT" } }}For more information about using Terraform with Google Cloud, see theTerraform on Google Cloud documentation.
View enabled alpha features
To view a list of enabled Compute Engine alpha features in your project,select one of the following options:
Console
In the Google Cloud console, go to thePreview features page.
In the table that appears, you can view the enabled features byverifying whether a green check mark appears next to a feature name.
gcloud
To view a list of enabled alpha features, use thegcloud compute preview-features list commandwith the--filter flag set toactivationStatus=ENABLED.
Execute the following command:
Linux, macOS, or Cloud Shell
gcloudcomputepreview-featureslist--filter=activationStatus=ENABLED
Windows (PowerShell)
gcloudcomputepreview-featureslist--filter=activationStatus=ENABLED
Windows (cmd.exe)
gcloudcomputepreview-featureslist--filter=activationStatus=ENABLED
You should receive a response similar to the following:
NAME STATUSalpha-feature-1 ENABLEDalpha-feature-2 ENABLED
REST
To view a list of enabled alpha features, make aGET request to thepreviewFeatures.list method.In the request URL, set thefilter query parameter toitems.activationStatus=ENABLED.
Before using any of the request data, make the following replacements:
- PROJECT_ID: the ID of your project
HTTP method and URL:
GET https://compute.googleapis.com/compute/projects/PROJECT_ID/global/previewFeatures?filter=activationStatus=ENABLED
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list.Execute the following command:
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://compute.googleapis.com/compute/projects/PROJECT_ID/global/previewFeatures?filter=activationStatus=ENABLED"
PowerShell (Windows)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list.Execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://compute.googleapis.com/compute/projects/PROJECT_ID/global/previewFeatures?filter=activationStatus=ENABLED" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "etag": "Ehx4OkkYX3CUXGRWAE8lvEn0ZDE=/rEhZfPEilwjblfZuwOYpO1nHC2c=", "id": "projects/example-project", "previewFeatures": [ { "activationStatus": "ENABLED", "creationTimestamp": "2025-03-01T00:00:00Z", "description": "Please see status.description for details.", "id": "560966157", "name": "alphaFeature1", "status": { "description": "Enables access to alpha APIs.", "helpLink": "some-link", "releaseStatus": { "stage": "GA", "updateDate": { "day": 1, "month": 3, "year": 2025 } } } }, ... ], "selfLink": "https://www.googleapis.com/compute/projects/example-project"}Disable an alpha feature
If you no longer need to use a Compute Engine alpha feature, then youcan disable your project access to it.
To disable your project from sending HTTP requests to the alpha URI of aCompute Engine feature, select one of the following options:
Console
In the Google Cloud console, go to thePreview features page.
ClickDisable next to the preview feature you want to disable. Then, in the dialog that appears, clickDisable again.
gcloud
To disable your project from sending HTTP requests to the alpha URI of aCompute Engine feature, use thegcloud compute preview-features update commandwith the--activation-status flag set tounspecified.
Before using any of the command data below, make the following replacements:
- FEATURE_NAME: the name of the feature that you want to stop using.
Execute the following command:
Linux, macOS, or Cloud Shell
gcloudcomputepreview-featuresupdateFEATURE_NAME\--activation-status=unspecified\--rollout-plan=fast-rollout
Windows (PowerShell)
gcloudcomputepreview-featuresupdateFEATURE_NAME`--activation-status=unspecified`--rollout-plan=fast-rollout
Windows (cmd.exe)
gcloudcomputepreview-featuresupdateFEATURE_NAME^--activation-status=unspecified^--rollout-plan=fast-rollout
You should receive a response similar to the following:
status: DONE
REST
To disable your project from sending HTTP requests to the alpha URI of aCompute Engine feature, make aPATCH request to thepreviewFeatures.update method.
Before using any of the request data, make the following replacements:
- PROJECT_ID: the ID of your project.
- FEATURE_NAME: the name of the feature that you want to stop using.
HTTP method and URL:
PATCH https://compute.googleapis.com/compute/projects/PROJECT_ID/global/previewFeatures/FEATURE_NAME
Request JSON body:
{ "activationStatus": "ACTIVATION_STATUS_UNSPECIFIED", "rolloutOperation": { "rolloutInput": { "predefinedRolloutPlan": "ROLLOUT_PLAN_FAST_ROLLOUT" } }}To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login , or by usingCloud Shell, which automatically logs you into thegcloud CLI . You can check the currently active account by runninggcloud auth list. Save the request body in a file namedrequest.json, and execute the following command:
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://compute.googleapis.com/compute/projects/PROJECT_ID/global/previewFeatures/FEATURE_NAME"
PowerShell (Windows)
Note: The following command assumes that you have logged in to thegcloud CLI with your user account by runninggcloud init orgcloud auth login . You can check the currently active account by runninggcloud auth list. Save the request body in a file namedrequest.json, and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://compute.googleapis.com/compute/projects/PROJECT_ID/global/previewFeatures/FEATURE_NAME" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "kind": "compute#operation", "status": "DONE"}Terraform
To disable your project from sending HTTP requests to the alpha URI of aCompute Engine feature, use thegoogle_compute_preview_feature Terraform resource.
For example, to disable access to all Compute Engine alpha features,use the following resource:
resource "google_compute_preview_feature" "default" { name = "alpha-api-access" activation_status = "ACTIVATION_STATE_UNSPECIFIED" rollout_operation { rollout_input { predefined_rollout_plan = "ROLLOUT_PLAN_FAST_ROLLOUT" } }}For more information about using Terraform with Google Cloud, see theTerraform on Google Cloud documentation.
What's next
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-19 UTC.