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:

Successful response

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 with RFC1035. (pattern: a-z?)
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.
creationTimestampstring[Output Only] Creation timestamp in RFC3339 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.
kindstring[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.
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.
resourceRequirementsobject[Input Only] Deprecated. (id: LicenseResourceRequirements)
selfLinkstring[Output Only] Server-defined URL for the resource.
selfLinkWithIdstring[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.
updateTimestampstring[Output Only] Last update timestamp in RFC3339 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 creating Cloud Marketplace images.
listselectprojectfilter, maxResults, orderBy, pageToken, 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 or windows-cloud. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.
insertinsertprojectrequestIdCreate a License resource in the specified project. Caution This resource is intended for use only by third-party partners who are creating Cloud 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 creating Cloud Marketplace images.
deletedeleteproject, licenserequestIdDeletes the specified license. Caution This resource is intended for use only by third-party partners who are creating Cloud 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 creating Cloud Marketplace images.

SELECT
id,
name,
allowedReplacementLicenses,
appendableToDisk,
chargesUseFee,
creationTimestamp,
description,
incompatibleLicenses,
kind,
licenseCode,
minimumRetention,
multiTenantOnly,
osLicense,
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 creating Cloud Marketplace images.

INSERT INTO google.compute.licenses (
data__kind,
data__name,
data__chargesUseFee,
data__id,
data__licenseCode,
data__creationTimestamp,
data__description,
data__transferable,
data__selfLink,
data__selfLinkWithId,
data__resourceRequirements,
data__appendableToDisk,
data__removableFromDisk,
data__allowedReplacementLicenses,
data__osLicense,
data__incompatibleLicenses,
data__requiredCoattachedLicenses,
data__soleTenantOnly,
data__multiTenantOnly,
data__minimumRetention,
data__updateTimestamp,
project,
requestId
)
SELECT
'{{ kind }}',
'{{ name }}',
{{ chargesUseFee }},
'{{ id }}',
'{{ licenseCode }}',
'{{ creationTimestamp }}',
'{{ description }}',
{{ transferable }},
'{{ selfLink }}',
'{{ selfLinkWithId }}',
'{{ resourceRequirements }}',
{{ appendableToDisk }},
{{ removableFromDisk }},
'{{ allowedReplacementLicenses }}',
{{ osLicense }},
'{{ incompatibleLicenses }}',
'{{ requiredCoattachedLicenses }}',
{{ soleTenantOnly }},
{{ multiTenantOnly }},
'{{ minimumRetention }}',
'{{ updateTimestamp }}',
'{{ project }}',
'{{ requestId }}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
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 creating Cloud Marketplace images.

UPDATE google.compute.licenses
SET
data__kind = '{{ kind }}',
data__name = '{{ name }}',
data__chargesUseFee = {{ chargesUseFee }},
data__id = '{{ id }}',
data__licenseCode = '{{ licenseCode }}',
data__creationTimestamp = '{{ creationTimestamp }}',
data__description = '{{ description }}',
data__transferable = {{ transferable }},
data__selfLink = '{{ selfLink }}',
data__selfLinkWithId = '{{ selfLinkWithId }}',
data__resourceRequirements = '{{ resourceRequirements }}',
data__appendableToDisk = {{ appendableToDisk }},
data__removableFromDisk = {{ removableFromDisk }},
data__allowedReplacementLicenses = '{{ allowedReplacementLicenses }}',
data__osLicense = {{ osLicense }},
data__incompatibleLicenses = '{{ incompatibleLicenses }}',
data__requiredCoattachedLicenses = '{{ requiredCoattachedLicenses }}',
data__soleTenantOnly = {{ soleTenantOnly }},
data__multiTenantOnly = {{ multiTenantOnly }},
data__minimumRetention = '{{ minimumRetention }}',
data__updateTimestamp = '{{ updateTimestamp }}'
WHERE
project = '{{ project }}' --required
AND license = '{{ license }}' --required
AND requestId = '{{ requestId}}'
AND updateMask = '{{ updateMask}}'
RETURNING
id,
name,
clientOperationId,
creationTimestamp,
description,
endTime,
error,
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 creating Cloud Marketplace images.

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