projects
Creates, updates, deletes, gets or lists a projects resource.
Overview
| Name | projects |
| Type | Resource |
| Id | google.compute.projects |
Fields
The following fields are returned by SELECT queries:
- get
| Name | Datatype | Description |
|---|---|---|
id | string (uint64) | [Output Only] The unique identifier for the resource. This identifier is defined by the server. This is not the project ID, and is just a unique ID used by Compute Engine to identify resources. |
name | string | The project ID. For example: my-example-project. Use the project ID to make requests to Compute Engine. |
cloudArmorTier | string | Output only. [Output Only] The Cloud Armor tier for this project. It can be one of the following values: CA_STANDARD,CA_ENTERPRISE_PAYGO. If this field is not specified, it is assumed to beCA_STANDARD. (CA_ENTERPRISE_ANNUAL, CA_ENTERPRISE_PAYGO, CA_STANDARD) |
commonInstanceMetadata | object | Metadata key/value pairs available to all instances contained in this project. See Custom metadata for more information. (id: Metadata) |
creationTimestamp | string | [Output Only] Creation timestamp inRFC3339 text format. |
defaultNetworkTier | string | This signifies the default network tier used for configuring resources of the project and can only take the following values:PREMIUM, STANDARD. Initially the default network tier is PREMIUM. (FIXED_STANDARD, PREMIUM, STANDARD, STANDARD_OVERRIDES_FIXED_STANDARD) |
defaultServiceAccount | string | [Output Only] Default service account used by VMs running in this project. |
description | string | An optional textual description of the resource. |
enabledFeatures | array | An optional list of restricted features enabled for use on this project. |
kind | string | Output only. [Output Only] Type of the resource. Always compute#project for projects. (default: compute#project) |
quotas | array | [Output Only] Quotas assigned to this project. |
selfLink | string | [Output Only] Server-defined URL for the resource. |
usageExportLocation | object | An optional naming prefix for daily usage reports and the Google Cloud Storage bucket where they are stored. (id: UsageExportLocation) |
vmDnsSetting | string | Output only. [Output Only] Default internal DNS setting used by VMs running in this project. (GLOBAL_DEFAULT, UNSPECIFIED_VM_DNS_SETTING, ZONAL_DEFAULT, ZONAL_ONLY) |
xpnProjectStatus | string | [Output Only] The role this project has in a shared VPC configuration. Currently, only projects with the host role, which is specified by the value HOST, are differentiated. (HOST, UNSPECIFIED_XPN_PROJECT_STATUS) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | project | Returns the specified Project resource. To decrease latency for this method, you can optionally omit any unneeded information from the response by using a field mask. This practice is especially recommended for unused quota information (the quotas field).To exclude one or more fields, set your request's fields query parameterto only include the fields you need. For example, to only include the idand selfLink fields, add the query parameter ?fields=id,selfLink toyour request. | |
move_disk | exec | project | requestId | Moves a persistent disk from one zone to another. Note: The moveDisk API will be deprecated on September 29, 2026. Starting September 29, 2025, you can't use the moveDisk API on new projects. To move a disk to a different region or zone, follow the steps in Change the location of a disk. Projects that already use the moveDisk API can continue usage until September 29, 2026. Starting November 1, 2025, API responses will include a warning message in the response body about the upcoming deprecation. You can skip the message to continue using the service without interruption. |
disable_xpn_host | exec | project | requestId | Disable this project as a shared VPC host project. |
set_default_network_tier | exec | project | requestId | Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field. |
set_cloud_armor_tier | exec | project | requestId | Sets the Cloud Armor tier of the project. To set ENTERPRISE or above the billing account of the project must be subscribed to Cloud Armor Enterprise. See Subscribing to Cloud Armor Enterprise for more information. |
move_instance | exec | project | requestId | Moves an instance and its attached persistent disks from one zone to another. Note: Moving VMs or disks by using this method might cause unexpected behavior. For more information, see the known issue. [Deprecated] This method is deprecated. See moving instance across zones instead. |
disable_xpn_resource | exec | project | requestId | Disable a service resource (also known as service project) associated with this host project. |
enable_xpn_host | exec | project | requestId | Enable this project as a shared VPC host project. |
enable_xpn_resource | exec | project | requestId | Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project. |
set_common_instance_metadata | exec | project | requestId | Sets metadata common to all instances within the specified project using the data included in the request. |
set_usage_export_bucket | exec | project | requestId | Enables the usage export feature and sets theusage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
project | string | |
requestId | string |
SELECT examples
- get
Returns the specified Project resource.
To decrease latency for this method, you can optionally omit any unneeded
information from the response by using a field mask. This practice is
especially recommended for unused quota information (the quotas field).
To exclude one or more fields, set your request's fields query parameter
to only include the fields you need. For example, to only include the id
and selfLink fields, add the query parameter ?fields=id,selfLink to
your request.
SELECT
id,
name,
cloudArmorTier,
commonInstanceMetadata,
creationTimestamp,
defaultNetworkTier,
defaultServiceAccount,
description,
enabledFeatures,
kind,
quotas,
selfLink,
usageExportLocation,
vmDnsSetting,
xpnProjectStatus
FROM google.compute.projects
WHERE project = '{{ project }}' -- required
;
Lifecycle Methods
- move_disk
- disable_xpn_host
- set_default_network_tier
- set_cloud_armor_tier
- move_instance
- disable_xpn_resource
- enable_xpn_host
- enable_xpn_resource
- set_common_instance_metadata
- set_usage_export_bucket
Moves a persistent disk from one zone to another.
Note: The moveDisk API will be deprecated on September 29, 2026.
Starting September 29, 2025, you can't use the moveDisk API on new
projects. To move a disk to a different region or zone, follow the steps in
Change the location of a
disk.
Projects that already use the moveDisk API can continue usage until
September 29, 2026.
Starting November 1, 2025, API responses will include a warning message in
the response body about the upcoming deprecation. You can skip the message
to continue using the service without interruption.
EXEC google.compute.projects.move_disk
@project='{{ project }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"targetDisk": "{{ targetDisk }}",
"destinationZone": "{{ destinationZone }}"
}'
;
Disable this project as a shared VPC host project.
EXEC google.compute.projects.disable_xpn_host
@project='{{ project }}' --required,
@requestId='{{ requestId }}'
;
Sets the default network tier of the project. The default network tier is
used when an address/forwardingRule/instance is created without specifying
the network tier field.
EXEC google.compute.projects.set_default_network_tier
@project='{{ project }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"networkTier": "{{ networkTier }}"
}'
;
Sets the Cloud Armor tier of the project. To set ENTERPRISE or above the
billing account of the project must be subscribed to Cloud Armor
Enterprise. See Subscribing
to Cloud Armor Enterprise for more information.
EXEC google.compute.projects.set_cloud_armor_tier
@project='{{ project }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"cloudArmorTier": "{{ cloudArmorTier }}"
}'
;
Moves an instance and its attached persistent disks from one zone to
another.
Note: Moving VMs or disks by using this method might
cause unexpected behavior. For more information, see the known
issue.
[Deprecated] This method is deprecated. See moving instance across
zones instead.
EXEC google.compute.projects.move_instance
@project='{{ project }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"destinationZone": "{{ destinationZone }}",
"targetInstance": "{{ targetInstance }}"
}'
;
Disable a service resource (also known as service project) associated with
this host project.
EXEC google.compute.projects.disable_xpn_resource
@project='{{ project }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"xpnResource": "{{ xpnResource }}"
}'
;
Enable this project as a shared VPC host project.
EXEC google.compute.projects.enable_xpn_host
@project='{{ project }}' --required,
@requestId='{{ requestId }}'
;
Enable service resource (a.k.a service project) for a host project, so that
subnets in the host project can be used by instances in the service
project.
EXEC google.compute.projects.enable_xpn_resource
@project='{{ project }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"xpnResource": "{{ xpnResource }}"
}'
;
Sets metadata common to all instances within the specified project using
the data included in the request.
EXEC google.compute.projects.set_common_instance_metadata
@project='{{ project }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"fingerprint": "{{ fingerprint }}",
"items": "{{ items }}"
}'
;
Enables the usage export feature and sets theusage export bucket
where reports are stored. If you provide an empty request body using this
method, the usage export feature will be disabled.
EXEC google.compute.projects.set_usage_export_bucket
@project='{{ project }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"bucketName": "{{ bucketName }}",
"reportNamePrefix": "{{ reportNamePrefix }}"
}'
;