node_templates
Creates, updates, deletes, gets or lists a node_templates resource.
Overview
| Name | node_templates |
| Type | Resource |
| Id | google.compute.node_templates |
Fields
The following fields are returned by SELECT queries:
- get
- list
- aggregated_list
| Name | Datatype | Description |
|---|---|---|
id | string (uint64) | Output only. [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
name | string | The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply withRFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. |
accelerators | array | |
cpuOvercommitType | string | CPU overcommit. (CPU_OVERCOMMIT_TYPE_UNSPECIFIED, ENABLED, NONE) |
creationTimestamp | string | Output only. [Output Only] Creation timestamp inRFC3339 text format. |
description | string | An optional description of this resource. Provide this property when you create the resource. |
disks | array | |
kind | string | Output only. [Output Only] The type of the resource. Alwayscompute#nodeTemplate for node templates. (default: compute#nodeTemplate) |
nodeAffinityLabels | object | Labels to use for node affinity, which will be used in instance scheduling. |
nodeType | string | The node type to use for nodes group that are created from this template. |
nodeTypeFlexibility | object | Do not use. Instead, use the node_type property. (id: NodeTemplateNodeTypeFlexibility) |
region | string | Output only. [Output Only] The name of the region where the node template resides, such as us-central1. |
selfLink | string | Output only. [Output Only] Server-defined URL for the resource. |
serverBinding | object | Sets the binding properties for the physical server. Valid values include: - [Default] RESTART_NODE_ON_ANY_SERVER: Restarts VMs on any available physical server - RESTART_NODE_ON_MINIMAL_SERVER: Restarts VMs on the same physical server whenever possible See Sole-tenant node options for more information. (id: ServerBinding) |
status | string | Output only. [Output Only] The status of the node template. One of the following values:CREATING, READY, and DELETING. (CREATING, DELETING, INVALID, READY) |
statusMessage | string | Output only. [Output Only] An optional, human-readable explanation of the status. |
| Name | Datatype | Description |
|---|---|---|
id | string | [Output Only] Unique identifier for the resource; defined by the server. |
items | array | A list of NodeTemplate resources. |
kind | string | Output only. [Output Only] Type of resource.Always compute#nodeTemplateList for lists of node templates. (default: compute#nodeTemplateList) |
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. |
| Name | Datatype | Description |
|---|---|---|
id | string (uint64) | Output only. [Output Only] The unique identifier for the resource. This identifier is defined by the server. |
name | string | The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply withRFC1035. Specifically, the name must be 1-63 characters long and match the regular expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash. |
accelerators | array | |
cpuOvercommitType | string | CPU overcommit. (CPU_OVERCOMMIT_TYPE_UNSPECIFIED, ENABLED, NONE) |
creationTimestamp | string | Output only. [Output Only] Creation timestamp inRFC3339 text format. |
description | string | An optional description of this resource. Provide this property when you create the resource. |
disks | array | |
kind | string | Output only. [Output Only] The type of the resource. Alwayscompute#nodeTemplate for node templates. (default: compute#nodeTemplate) |
nodeAffinityLabels | object | Labels to use for node affinity, which will be used in instance scheduling. |
nodeType | string | The node type to use for nodes group that are created from this template. |
nodeTypeFlexibility | object | Do not use. Instead, use the node_type property. (id: NodeTemplateNodeTypeFlexibility) |
region | string | Output only. [Output Only] The name of the region where the node template resides, such as us-central1. |
selfLink | string | Output only. [Output Only] Server-defined URL for the resource. |
serverBinding | object | Sets the binding properties for the physical server. Valid values include: - [Default] RESTART_NODE_ON_ANY_SERVER: Restarts VMs on any available physical server - RESTART_NODE_ON_MINIMAL_SERVER: Restarts VMs on the same physical server whenever possible See Sole-tenant node options for more information. (id: ServerBinding) |
status | string | Output only. [Output Only] The status of the node template. One of the following values:CREATING, READY, and DELETING. (CREATING, DELETING, INVALID, READY) |
statusMessage | string | Output only. [Output Only] An optional, human-readable explanation of the status. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | project, region, nodeTemplate | Returns the specified node template. | |
list | select | project, region | orderBy, maxResults, pageToken, filter, returnPartialSuccess | Retrieves a list of node templates available to the specified project. |
aggregated_list | select | project | returnPartialSuccess, includeAllScopes, orderBy, filter, serviceProjectNumber, maxResults, pageToken | Retrieves an aggregated list of node templates. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true. |
insert | insert | project, region | requestId | Creates a NodeTemplate resource in the specified project using the data included in the request. |
delete | delete | project, region, nodeTemplate | requestId | Deletes the specified NodeTemplate resource. |
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 |
|---|---|---|
nodeTemplate | string | |
project | string | |
region | string | |
filter | string | |
includeAllScopes | boolean | |
maxResults | integer (uint32) | |
orderBy | string | |
pageToken | string | |
requestId | string | |
returnPartialSuccess | boolean | |
serviceProjectNumber | string (int64) |
SELECT examples
- get
- list
- aggregated_list
Returns the specified node template.
SELECT
id,
name,
accelerators,
cpuOvercommitType,
creationTimestamp,
description,
disks,
kind,
nodeAffinityLabels,
nodeType,
nodeTypeFlexibility,
region,
selfLink,
serverBinding,
status,
statusMessage
FROM google.compute.node_templates
WHERE project = '{{ project }}' -- required
AND region = '{{ region }}' -- required
AND nodeTemplate = '{{ nodeTemplate }}' -- required
;
Retrieves a list of node templates available to the specified
project.
SELECT
id,
items,
kind,
nextPageToken,
selfLink,
warning
FROM google.compute.node_templates
WHERE project = '{{ project }}' -- required
AND region = '{{ region }}' -- required
AND orderBy = '{{ orderBy }}'
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
;
Retrieves an aggregated list of node templates.
To prevent failure, Google recommends that you set thereturnPartialSuccess parameter to true.
SELECT
id,
name,
accelerators,
cpuOvercommitType,
creationTimestamp,
description,
disks,
kind,
nodeAffinityLabels,
nodeType,
nodeTypeFlexibility,
region,
selfLink,
serverBinding,
status,
statusMessage
FROM google.compute.node_templates
WHERE project = '{{ project }}' -- required
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
AND includeAllScopes = '{{ includeAllScopes }}'
AND orderBy = '{{ orderBy }}'
AND filter = '{{ filter }}'
AND serviceProjectNumber = '{{ serviceProjectNumber }}'
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
;
INSERT examples
- insert
- Manifest
Creates a NodeTemplate resource in the specified project using the data
included in the request.
INSERT INTO google.compute.node_templates (
data__description,
data__disks,
data__nodeType,
data__serverBinding,
data__name,
data__nodeAffinityLabels,
data__cpuOvercommitType,
data__nodeTypeFlexibility,
data__accelerators,
project,
region,
requestId
)
SELECT
'{{ description }}',
'{{ disks }}',
'{{ nodeType }}',
'{{ serverBinding }}',
'{{ name }}',
'{{ nodeAffinityLabels }}',
'{{ cpuOvercommitType }}',
'{{ nodeTypeFlexibility }}',
'{{ accelerators }}',
'{{ project }}',
'{{ region }}',
'{{ 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: node_templates
props:
- name: project
value: "{{ project }}"
description: Required parameter for the node_templates resource.
- name: region
value: "{{ region }}"
description: Required parameter for the node_templates resource.
- name: description
value: "{{ description }}"
description: |
An optional description of this resource. Provide this property when you
create the resource.
- name: disks
value:
- diskSizeGb: {{ diskSizeGb }}
diskCount: {{ diskCount }}
diskType: "{{ diskType }}"
- name: nodeType
value: "{{ nodeType }}"
description: |
The node type to use for nodes group that are created from this template.
- name: serverBinding
description: |
Sets the binding properties for the physical server. Valid values include:
- *[Default]* RESTART_NODE_ON_ANY_SERVER:
Restarts VMs on any available
physical server
- RESTART_NODE_ON_MINIMAL_SERVER: Restarts VMs on the same
physical server whenever possible
See Sole-tenant
node options for more information.
value:
type: "{{ type }}"
- name: name
value: "{{ name }}"
description: |
The name of the resource, provided by the client when initially creating
the resource. The resource name must be 1-63 characters long, and comply
withRFC1035.
Specifically, the name must be 1-63 characters long and match the regular
expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first
character must be a lowercase letter, and all following characters must be
a dash, lowercase letter, or digit, except the last character, which
cannot be a dash.
- name: nodeAffinityLabels
value: "{{ nodeAffinityLabels }}"
description: |
Labels to use for node affinity, which will be used in instance scheduling.
- name: cpuOvercommitType
value: "{{ cpuOvercommitType }}"
description: |
CPU overcommit.
valid_values: ['CPU_OVERCOMMIT_TYPE_UNSPECIFIED', 'ENABLED', 'NONE']
- name: nodeTypeFlexibility
description: |
Do not use. Instead, use the node_type property.
value:
cpus: "{{ cpus }}"
memory: "{{ memory }}"
localSsd: "{{ localSsd }}"
- name: accelerators
value:
- acceleratorType: "{{ acceleratorType }}"
acceleratorCount: {{ acceleratorCount }}
- name: requestId
value: "{{ requestId }}"
DELETE examples
- delete
Deletes the specified NodeTemplate resource.
DELETE FROM google.compute.node_templates
WHERE project = '{{ project }}' --required
AND region = '{{ region }}' --required
AND nodeTemplate = '{{ nodeTemplate }}' --required
AND requestId = '{{ requestId }}'
;