licenses
Creates, updates, deletes, gets or lists a licenses resource.
Overview
| Name | licenses |
| Type | Resource |
| Id | google.compute.licenses |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
id | string (uint64) | [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
name | string | Name 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])?) |
allowedReplacementLicenses | array | Specifies licenseCodes of licenses that can replace this license. Note: such replacements are allowed even if removable_from_disk is false. |
appendableToDisk | boolean | If true, this license can be appended to an existing disk's set of licenses. |
chargesUseFee | boolean | [Output Only] Deprecated. This field no longer reflects whether a license charges a usage fee. |
creationTimestamp | string | Output only. [Output Only] Creation timestamp inRFC3339 text format. |
description | string | An optional textual description of the resource; provided by the client when the resource is created. |
incompatibleLicenses | array | 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. |
kind | string | Output only. [Output Only] Type of resource. Always compute#license for licenses. (default: compute#license) |
licenseCode | string (uint64) | [Output Only] The unique code used to attach this license to images, snapshots, and disks. |
minimumRetention | object | A 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) |
multiTenantOnly | boolean | If true, this license can only be used on VMs on multi tenant nodes. |
osLicense | boolean | If true, indicates this is an OS license. Only one OS license can be attached to a disk or image at a time. |
params | object | Input only. Additional params passed with the request, but not persisted as part of resource payload. (id: LicenseParams) |
removableFromDisk | boolean | If true, this license can be removed from a disk's set of licenses, with no replacement license needed. |
requiredCoattachedLicenses | array | 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. |
resourceRequirements | object | [Input Only] Deprecated. (id: LicenseResourceRequirements) |
selfLink | string | Output only. [Output Only] Server-defined URL for the resource. |
selfLinkWithId | string | Output only. [Output Only] Server-defined URL for this resource with the resource id. |
soleTenantOnly | boolean | If true, this license can only be used on VMs on sole tenant nodes. |
transferable | boolean | If false, licenses will not be copied from the source resource when creating an image from a disk, disk from snapshot, or snapshot from disk. |
updateTimestamp | string | Output only. [Output Only] Last update timestamp inRFC3339 text format. |
| Name | Datatype | Description |
|---|---|---|
id | string | [Output Only] Unique identifier for the resource; defined by the server. |
items | array | A list of License resources. |
nextPageToken | string | [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger thanmaxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results. |
selfLink | string | Output only. [Output Only] Server-defined URL for this resource. |
warning | object | [Output Only] Informational warning message. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | project, license | Returns the specified License resource. Caution This resource is intended for use only by third-party partners who are creatingCloud Marketplace images. | |
list | select | project | orderBy, maxResults, pageToken, filter, returnPartialSuccess | Retrieves 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. |
insert | insert | project | requestId | 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. |
update | update | project, license | requestId, updateMask | 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. |
delete | delete | project, license | requestId | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
license | string | |
project | string | |
filter | string | |
maxResults | integer (uint32) | |
orderBy | string | |
pageToken | string | |
requestId | string | |
returnPartialSuccess | boolean | |
updateMask | string (google-fieldmask) |
SELECT examples
- get
- list
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
;
Retrieves 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.
SELECT
id,
items,
nextPageToken,
selfLink,
warning
FROM google.compute.licenses
WHERE project = '{{ project }}' -- required
AND orderBy = '{{ orderBy }}'
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
;
INSERT examples
- insert
- Manifest
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
;
# Description fields are for documentation purposes
- name: licenses
props:
- name: project
value: "{{ project }}"
description: Required parameter for the licenses resource.
- name: incompatibleLicenses
value:
- "{{ incompatibleLicenses }}"
description: |
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.
- name: soleTenantOnly
value: {{ soleTenantOnly }}
description: |
If true, this license can only be used on VMs on sole tenant nodes.
- name: appendableToDisk
value: {{ appendableToDisk }}
description: |
If true, this license can be appended to an existing disk's set of
licenses.
- name: description
value: "{{ description }}"
description: |
An optional textual description of the resource; provided by the client
when the resource is created.
- name: resourceRequirements
description: |
[Input Only] Deprecated.
value:
minMemoryMb: {{ minMemoryMb }}
minGuestCpuCount: {{ minGuestCpuCount }}
- name: requiredCoattachedLicenses
value:
- "{{ requiredCoattachedLicenses }}"
description: |
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.
- name: allowedReplacementLicenses
value:
- "{{ allowedReplacementLicenses }}"
description: |
Specifies licenseCodes of licenses that can replace this license. Note:
such replacements are allowed even if removable_from_disk is false.
- name: id
value: "{{ id }}"
description: |
[Output Only] The unique identifier for the resource. This identifier is
defined by the server.
- name: chargesUseFee
value: {{ chargesUseFee }}
description: |
[Output Only] Deprecated. This field no longer reflects whether a license
charges a usage fee.
- name: licenseCode
value: "{{ licenseCode }}"
description: |
[Output Only] The unique code used to attach this license to images,
snapshots, and disks.
- name: osLicense
value: {{ osLicense }}
description: |
If true, indicates this is an OS license. Only one OS license can be
attached to a disk or image at a time.
- name: multiTenantOnly
value: {{ multiTenantOnly }}
description: |
If true, this license can only be used on VMs on multi tenant nodes.
- name: params
description: |
Input only. Additional params passed with the request, but not persisted
as part of resource payload.
value:
resourceManagerTags: "{{ resourceManagerTags }}"
- name: transferable
value: {{ transferable }}
description: |
If false, licenses will not be copied from the source resource when
creating an image from a disk, disk from snapshot, or snapshot from disk.
- name: name
value: "{{ name }}"
description: |
Name of the resource. The name must be 1-63 characters long and
comply withRFC1035.
- name: removableFromDisk
value: {{ removableFromDisk }}
description: |
If true, this license can be removed from a disk's set of licenses, with no
replacement license needed.
- name: minimumRetention
description: |
A 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.
value:
nanos: {{ nanos }}
seconds: "{{ seconds }}"
- name: requestId
value: "{{ requestId }}"
UPDATE examples
- update
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
- delete
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 }}'
;