Skip to main content

licenses

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

Overview

Namelicenses
TypeResource
Idgoogle.compute.licenses

Fields

NameDatatypeDescription
idstring[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.
descriptionstringAn optional textual description of the resource; provided by the client when the resource is created.
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.
kindstring[Output Only] Type of resource. Always compute#license for licenses.
licenseCodestring[Output Only] The unique code used to attach this license to images, snapshots, and disks.
resourceRequirementsobject
selfLinkstring[Output Only] Server-defined URL for the resource.
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.

Methods

NameAccessible byRequired ParamsDescription
getSELECTlicense, projectReturns the specified License resource. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.
listSELECTprojectRetrieves 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.
insertINSERTprojectCreate 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.
deleteDELETElicense, projectDeletes the specified license. Caution This resource is intended for use only by third-party partners who are creating Cloud Marketplace images.

SELECT examples

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,
name,
description,
chargesUseFee,
creationTimestamp,
kind,
licenseCode,
resourceRequirements,
selfLink,
transferable
FROM google.compute.licenses
WHERE project = '{{ project }}';

INSERT example

Use the following StackQL query and manifest file to create a new licenses resource.

/*+ create */
INSERT INTO google.compute.licenses (
project,
name,
chargesUseFee,
licenseCode,
description,
transferable,
resourceRequirements
)
SELECT
'{{ project }}',
'{{ name }}',
{{ chargesUseFee }},
'{{ licenseCode }}',
'{{ description }}',
{{ transferable }},
'{{ resourceRequirements }}'
;

DELETE example

Deletes the specified licenses resource.

/*+ delete */
DELETE FROM google.compute.licenses
WHERE license = '{{ license }}'
AND project = '{{ project }}';