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
Successful response
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 with RFC1035. (pattern: a-z?) |
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] Creation timestamp in RFC3339 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] 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 | If 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) |
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. |
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] Server-defined URL for the resource. |
selfLinkWithId | string | [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] Last update timestamp in RFC3339 text format. |
Successful response
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 than maxResults, 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] 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 creating Cloud Marketplace images. | |
list | select | project | filter , maxResults , orderBy , pageToken , 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 or windows-cloud. Caution This resource is intended for use only by third-party partners who are creating Cloud 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 creating Cloud 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 creating Cloud 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 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.
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 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;
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 or windows-cloud. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.
SELECT
id,
items,
nextPageToken,
selfLink,
warning
FROM google.compute.licenses
WHERE project = '{{ project }}' -- required
AND filter = '{{ filter }}'
AND maxResults = '{{ maxResults }}'
AND orderBy = '{{ orderBy }}'
AND pageToken = '{{ pageToken }}'
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 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
;
# Description fields are for documentation purposes
- name: licenses
props:
- name: project
value: string
description: Required parameter for the licenses resource.
- name: kind
value: string
description: >
[Output Only] Type of resource. Always compute#license for licenses.
default: compute#license
- name: name
value: string
description: >
Name of the resource. The name must be 1-63 characters long and comply with RFC1035.
- name: chargesUseFee
value: boolean
description: >
[Output Only] Deprecated. This field no longer reflects whether a license charges a usage fee.
- name: id
value: string
description: >
[Output Only] The unique identifier for the resource. This identifier is defined by the server.
- name: licenseCode
value: string
description: >
[Output Only] The unique code used to attach this license to images, snapshots, and disks.
- name: creationTimestamp
value: string
description: >
[Output Only] Creation timestamp in RFC3339 text format.
- name: description
value: string
description: >
An optional textual description of the resource; provided by the client when the resource is created.
- name: transferable
value: boolean
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: selfLink
value: string
description: >
[Output Only] Server-defined URL for the resource.
- name: selfLinkWithId
value: string
description: >
[Output Only] Server-defined URL for this resource with the resource id.
- name: resourceRequirements
value: object
description: >
[Input Only] Deprecated.
- name: appendableToDisk
value: boolean
description: >
If true, this license can be appended to an existing disk's set of licenses.
- name: removableFromDisk
value: boolean
description: >
If true, this license can be removed from a disk's set of licenses, with no replacement license needed.
- name: allowedReplacementLicenses
value: array
description: >
Specifies licenseCodes of licenses that can replace this license. Note: such replacements are allowed even if removable_from_disk is false.
- name: osLicense
value: boolean
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: incompatibleLicenses
value: array
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: requiredCoattachedLicenses
value: array
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: soleTenantOnly
value: boolean
description: >
If true, this license can only be used on VMs on sole tenant nodes.
- name: multiTenantOnly
value: boolean
description: >
If true, this license can only be used on VMs on multi tenant nodes.
- name: minimumRetention
value: object
description: >
If set, this license will be unable to be removed or replaced once attached to a disk until the minimum_retention period has passed.
- name: updateTimestamp
value: string
description: >
[Output Only] Last update timestamp in RFC3339 text format.
- name: requestId
value: string
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 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
- delete
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 }}';