- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- IAM Permissions
- Try it!
Return a specified license code. License codes are mirrored across all projects that have permissions to read the License Code.
HTTP request
GET https://compute.googleapis.com/compute/v1/projects/{project}/global/licenseCodes/{licenseCode}
The URL uses gRPC Transcoding syntax. To know more about valid error responses that can be thrown by this HTTP request, please refer to the service error catalog
Path parameters
| Parameters | |
|---|---|
project |
Project ID for this request. |
licenseCode |
Number corresponding to the License code resource to return. |
Request body
The request body must be empty.
Response body
Represents a License Code resource.
A License Code is a unique identifier used to represent a license resource.
If successful, the response body contains data with the following structure:
| JSON representation |
|---|
{ "kind": string, "id": string, "name": string, "creationTimestamp": string, "description": string, "selfLink": string, "transferable": boolean, "state": enum, "licenseAlias": [ { "selfLink": string, "description": string } ], "appendableToDisk": boolean, "removableFromDisk": boolean, "allowedReplacementLicenses": [ string ], "osLicense": boolean, "incompatibleLicenses": [ string ], "requiredCoattachedLicenses": [ string ], "soleTenantOnly": boolean, "multiTenantOnly": boolean, "minimumRetention": { "seconds": string, "nanos": integer }, "updateTimestamp": string } |
| Fields | |
|---|---|
kind |
Output only. Type of resource. Always |
id |
Output only. The unique identifier for the resource. This identifier is defined by the server. |
name |
Output only. Name of the resource. The name is 1-20 characters long and must be a valid 64 bit integer. |
creationTimestamp |
Output only. Creation timestamp in RFC3339 text format. |
description |
Output only. Description of this License Code. |
selfLink |
Output only. Server-defined URL for the resource. |
transferable |
Output only. If true, the license will remain attached when creating images or snapshots from disks. Otherwise, the license is not transferred. |
state |
Output only. Current state of this License Code. |
licenseAlias[] |
Output only. URL and description aliases of Licenses with the same License Code. |
licenseAlias[].selfLink |
Output only. URL of license corresponding to this License Code. |
licenseAlias[].description |
Output only. Description of this License Code. |
appendableToDisk |
If true, this license can be appended to an existing disk's set of licenses. Available from 2026-03-01.. |
removableFromDisk |
If true, this license can be removed from a disk's set of licenses, with no replacement license needed. Available from 2026-03-01.. |
allowedReplacementLicenses[] |
Specifies licenseCodes of licenses that can replace this license. Note: such replacements are allowed even if removableFromDisk is false. Available from 2026-03-01.. |
osLicense |
If true, indicates this is an OS license. Only one OS license can be attached to a disk or image at a time. Available from 2026-03-01.. |
incompatibleLicenses[] |
Specifies licenseCodes of licenses that are incompatible with this license. If a license is incompatible with this license, it cannot be attached to the same disk or image. Available from 2026-03-01.. |
requiredCoattachedLicenses[] |
Specifies the set of permissible coattached licenseCodes of licenses that satisfy the coattachment requirement of this license. At least one license from the set must be attached to the same disk or image as this license. Available from 2026-03-01.. |
soleTenantOnly |
If true, this license can only be used on VMs on sole tenant nodes. Available from 2026-03-01.. |
multiTenantOnly |
If true, this license can only be used on VMs on multi tenant nodes. Available from 2026-03-01.. |
minimumRetention |
If set, this license will be unable to be removed or replaced once attached to a disk until the minimumRetention period has passed. Available from 2026-03-01.. |
minimumRetention.seconds |
Span of time at a resolution of a second. Must be from 0 to 315,576,000,000 inclusive. Note: these bounds are computed from: 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years |
minimumRetention.nanos |
Span of time that's a fraction of a second at nanosecond resolution. Durations less than one second are represented with a 0 |
updateTimestamp |
Output only. Last update timestamp in RFC3339 text format. Available from 2026-03-01.. |
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/compute.readonlyhttps://www.googleapis.com/auth/computehttps://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.
IAM Permissions
In addition to any permissions specified on the fields above, authorization requires one or more of the following IAM permissions:
compute.licenseCodes.get
To find predefined roles that contain those permissions, see Compute Engine IAM Roles.