Skip to main content

licenses

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

Overview

Namelicenses
TypeResource
Idgoogle.compute.licenses

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring (uint64)[Output Only] The unique identifier for the resource. This identifier is defined by the server.
namestringName of the resource. The name must be 1-63 characters long and comply withRFC1035. (pattern: [a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)
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.
chargesUseFeeboolean[Output Only] Deprecated. This field no longer reflects whether a license charges a usage fee.
creationTimestampstringOutput only. [Output Only] Creation timestamp inRFC3339 text format.
descriptionstringAn optional textual description of the resource; provided by the client when the resource is created.
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#license for licenses. (default: compute#license)
licenseCodestring (uint64)[Output Only] The unique code used to attach this license to images, snapshots, and disks.
minimumRetentionobjectA Duration represents a fixed-length span of time represented as a count of seconds and fractions of seconds at nanosecond resolution. It is independent of any calendar and concepts like "day" or "month". Range is approximately 10,000 years. (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.
paramsobjectInput only. Additional params passed with the request, but not persisted as part of resource payload. (id: LicenseParams)
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.
resourceRequirementsobject[Input Only] Deprecated. (id: LicenseResourceRequirements)
selfLinkstringOutput only. [Output Only] Server-defined URL for the resource.
selfLinkWithIdstringOutput only. [Output Only] Server-defined URL for this resource with the resource id.
soleTenantOnlybooleanIf true, this license can only be used on VMs on sole tenant nodes.
transferablebooleanIf false, licenses will not be copied from the source resource when creating an image from a disk, disk from snapshot, or snapshot from disk.
updateTimestampstringOutput only. [Output Only] Last update timestamp inRFC3339 text format.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectproject, licenseReturns the specified License resource.
Caution This resource is intended
for use only by third-party partners who are creatingCloud Marketplace
images.
listselectprojectorderBy, maxResults, pageToken, filter, returnPartialSuccessRetrieves the list of licenses
available in the specified project. This method does not
get any licenses that belong to other projects, including licenses attached
to publicly-available images, like Debian 9. If you want to get a list of
publicly-available licenses, use this method to make a request to the
respective image project, such as debian-cloud orwindows-cloud.
Caution This resource is intended
for use only by third-party partners who are creatingCloud Marketplace
images.
insertinsertprojectrequestIdCreate a License resource in the specified project.
Caution This resource is intended
for use only by third-party partners who are creatingCloud Marketplace
images.
updateupdateproject, licenserequestId, updateMaskUpdates a License resource in the specified project.
Caution This resource is intended
for use only by third-party partners who are creatingCloud Marketplace
images.
deletedeleteproject, licenserequestIdDeletes the specified license.
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
licensestring
projectstring
filterstring
maxResultsinteger (uint32)
orderBystring
pageTokenstring
requestIdstring
returnPartialSuccessboolean
updateMaskstring (google-fieldmask)

SELECT examples

Returns the specified License resource.
Caution This resource is intended
for use only by third-party partners who are creatingCloud Marketplace
images.

SELECT
id,
name,
allowedReplacementLicenses,
appendableToDisk,
chargesUseFee,
creationTimestamp,
description,
incompatibleLicenses,
kind,
licenseCode,
minimumRetention,
multiTenantOnly,
osLicense,
params,
removableFromDisk,
requiredCoattachedLicenses,
resourceRequirements,
selfLink,
selfLinkWithId,
soleTenantOnly,
transferable,
updateTimestamp
FROM google.compute.licenses
WHERE project = '{{ project }}' -- required
AND license = '{{ license }}' -- required
;

INSERT examples

Create a License resource in the specified project.
Caution This resource is intended
for use only by third-party partners who are creatingCloud Marketplace
images.

INSERT INTO google.compute.licenses (
data__incompatibleLicenses,
data__soleTenantOnly,
data__appendableToDisk,
data__description,
data__resourceRequirements,
data__requiredCoattachedLicenses,
data__allowedReplacementLicenses,
data__id,
data__chargesUseFee,
data__licenseCode,
data__osLicense,
data__multiTenantOnly,
data__params,
data__transferable,
data__name,
data__removableFromDisk,
data__minimumRetention,
project,
requestId
)
SELECT
'{{ incompatibleLicenses }}',
{{ soleTenantOnly }},
{{ appendableToDisk }},
'{{ description }}',
'{{ resourceRequirements }}',
'{{ requiredCoattachedLicenses }}',
'{{ allowedReplacementLicenses }}',
'{{ id }}',
{{ chargesUseFee }},
'{{ licenseCode }}',
{{ osLicense }},
{{ multiTenantOnly }},
'{{ params }}',
{{ transferable }},
'{{ name }}',
{{ removableFromDisk }},
'{{ minimumRetention }}',
'{{ project }}',
'{{ requestId }}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
getVersionOperationMetadata,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone
;

UPDATE examples

Updates a License resource in the specified project.
Caution This resource is intended
for use only by third-party partners who are creatingCloud Marketplace
images.

UPDATE google.compute.licenses
SET
data__incompatibleLicenses = '{{ incompatibleLicenses }}',
data__soleTenantOnly = {{ soleTenantOnly }},
data__appendableToDisk = {{ appendableToDisk }},
data__description = '{{ description }}',
data__resourceRequirements = '{{ resourceRequirements }}',
data__requiredCoattachedLicenses = '{{ requiredCoattachedLicenses }}',
data__allowedReplacementLicenses = '{{ allowedReplacementLicenses }}',
data__id = '{{ id }}',
data__chargesUseFee = {{ chargesUseFee }},
data__licenseCode = '{{ licenseCode }}',
data__osLicense = {{ osLicense }},
data__multiTenantOnly = {{ multiTenantOnly }},
data__params = '{{ params }}',
data__transferable = {{ transferable }},
data__name = '{{ name }}',
data__removableFromDisk = {{ removableFromDisk }},
data__minimumRetention = '{{ minimumRetention }}'
WHERE
project = '{{ project }}' --required
AND license = '{{ license }}' --required
AND requestId = '{{ requestId}}'
AND updateMask = '{{ updateMask}}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
getVersionOperationMetadata,
httpErrorMessage,
httpErrorStatusCode,
insertTime,
instancesBulkInsertOperationMetadata,
kind,
operationGroupId,
operationType,
progress,
region,
selfLink,
setCommonInstanceMetadataOperationMetadata,
startTime,
status,
statusMessage,
targetId,
targetLink,
user,
warnings,
zone;

DELETE examples

Deletes the specified license.
Caution This resource is intended
for use only by third-party partners who are creatingCloud Marketplace
images.

DELETE FROM google.compute.licenses
WHERE project = '{{ project }}' --required
AND license = '{{ license }}' --required
AND requestId = '{{ requestId }}'
;