Skip to main content

license_codes

Creates, updates, deletes, gets or lists a license_codes resource.

Overview

Namelicense_codes
TypeResource
Idgoogle.compute.license_codes

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring (uint64)Output only. [Output Only] The unique identifier for the resource. This identifier is defined by the server.
namestringOutput only. [Output Only] Name of the resource. The name is 1-20 characters long and must be a valid 64 bit integer. (pattern: [0-9]{0,20}?)
allowedReplacementLicensesarraySpecifies licenseCodes of licenses that can replace this license. Note: such replacements are allowed even if removable_from_disk is false.
appendableToDiskbooleanIf true, this license can be appended to an existing disk's set of licenses.
creationTimestampstringOutput only. [Output Only] Creation timestamp inRFC3339 text format.
descriptionstringOutput only. [Output Only] Description of this License Code.
incompatibleLicensesarraySpecifies 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.
kindstringOutput only. [Output Only] Type of resource. Always compute#licenseCode for licenses. (default: compute#licenseCode)
licenseAliasarray[Output Only] URL and description aliases of Licenses with the same License Code.
minimumRetentionobjectIf set, this license will be unable to be removed or replaced once attached to a disk until the minimum_retention period has passed. (id: Duration)
multiTenantOnlybooleanIf true, this license can only be used on VMs on multi tenant nodes.
osLicensebooleanIf true, indicates this is an OS license. Only one OS license can be attached to a disk or image at a time.
removableFromDiskbooleanIf true, this license can be removed from a disk's set of licenses, with no replacement license needed.
requiredCoattachedLicensesarraySpecifies 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.
selfLinkstringOutput only. [Output Only] Server-defined URL for the resource.
soleTenantOnlybooleanIf true, this license can only be used on VMs on sole tenant nodes.
statestringOutput only. [Output Only] Current state of this License Code. (DISABLED, ENABLED, RESTRICTED, STATE_UNSPECIFIED, TERMINATED)
transferablebooleanOutput only. [Output Only] If true, the license will remain attached when creating images or snapshots from disks. Otherwise, the license is not transferred.
updateTimestampstringOutput only. [Output Only] Last update timestamp inRFC3339 text format.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectproject, licenseCodeReturn a specified license code. License codes are mirrored across
all projects that have permissions to read the License Code.
Caution This resource is intended
for use only by third-party partners who are creatingCloud Marketplace
images.

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.

NameDatatypeDescription
licenseCodestring
projectstring

SELECT examples

Return a specified license code. License codes are mirrored across
all projects that have permissions to read the License Code.
Caution This resource is intended
for use only by third-party partners who are creatingCloud Marketplace
images.

SELECT
id,
name,
allowedReplacementLicenses,
appendableToDisk,
creationTimestamp,
description,
incompatibleLicenses,
kind,
licenseAlias,
minimumRetention,
multiTenantOnly,
osLicense,
removableFromDisk,
requiredCoattachedLicenses,
selfLink,
soleTenantOnly,
state,
transferable,
updateTimestamp
FROM google.compute.license_codes
WHERE project = '{{ project }}' -- required
AND licenseCode = '{{ licenseCode }}' -- required
;