licenses
Creates, updates, deletes, gets or lists a licenses
resource.
Overview
Name | licenses |
Type | Resource |
Id | google.compute.licenses |
Fields
Name | Datatype | Description |
---|---|---|
id | string | [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. |
description | string | An optional textual description of the resource; provided by the client when the resource is created. |
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. |
kind | string | [Output Only] Type of resource. Always compute#license for licenses. |
licenseCode | string | [Output Only] The unique code used to attach this license to images, snapshots, and disks. |
resourceRequirements | object | |
selfLink | string | [Output Only] Server-defined URL for the resource. |
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. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | license, project | 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 | 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 | 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. |
delete | DELETE | license, project | Deletes 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.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.compute.licenses (
project,
name,
chargesUseFee,
licenseCode,
description,
transferable,
resourceRequirements
)
SELECT
'{{ project }}',
'{{ name }}',
{{ chargesUseFee }},
'{{ licenseCode }}',
'{{ description }}',
{{ transferable }},
'{{ resourceRequirements }}'
;
- name: your_resource_model_name
props:
- name: kind
value: string
- name: name
value: string
- name: chargesUseFee
value: boolean
- name: id
value: string
- name: licenseCode
value: string
- name: creationTimestamp
value: string
- name: description
value: string
- name: transferable
value: boolean
- name: selfLink
value: string
- name: resourceRequirements
value:
- name: minGuestCpuCount
value: integer
- name: minMemoryMb
value: integer
DELETE
example
Deletes the specified licenses
resource.
/*+ delete */
DELETE FROM google.compute.licenses
WHERE license = '{{ license }}'
AND project = '{{ project }}';