Skip to main content

node_templates

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

Overview

Namenode_templates
TypeResource
Idgoogle.compute.node_templates

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstring (uint64)Output only. [Output Only] The unique identifier for the resource. This identifier is defined by the server.
namestringThe 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.
acceleratorsarray
cpuOvercommitTypestringCPU overcommit. (CPU_OVERCOMMIT_TYPE_UNSPECIFIED, ENABLED, NONE)
creationTimestampstringOutput only. [Output Only] Creation timestamp inRFC3339 text format.
descriptionstringAn optional description of this resource. Provide this property when you create the resource.
disksarray
kindstringOutput only. [Output Only] The type of the resource. Alwayscompute#nodeTemplate for node templates. (default: compute#nodeTemplate)
nodeAffinityLabelsobjectLabels to use for node affinity, which will be used in instance scheduling.
nodeTypestringThe node type to use for nodes group that are created from this template.
nodeTypeFlexibilityobjectDo not use. Instead, use the node_type property. (id: NodeTemplateNodeTypeFlexibility)
regionstringOutput only. [Output Only] The name of the region where the node template resides, such as us-central1.
selfLinkstringOutput only. [Output Only] Server-defined URL for the resource.
serverBindingobjectSets 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)
statusstringOutput only. [Output Only] The status of the node template. One of the following values:CREATING, READY, and DELETING. (CREATING, DELETING, INVALID, READY)
statusMessagestringOutput only. [Output Only] An optional, human-readable explanation of the status.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectproject, region, nodeTemplateReturns the specified node template.
listselectproject, regionorderBy, maxResults, pageToken, filter, returnPartialSuccessRetrieves a list of node templates available to the specified
project.
aggregated_listselectprojectreturnPartialSuccess, includeAllScopes, orderBy, filter, serviceProjectNumber, maxResults, pageTokenRetrieves an aggregated list of node templates.

To prevent failure, Google recommends that you set the
returnPartialSuccess parameter to true.
insertinsertproject, regionrequestIdCreates a NodeTemplate resource in the specified project using the data
included in the request.
deletedeleteproject, region, nodeTemplaterequestIdDeletes 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.

NameDatatypeDescription
nodeTemplatestring
projectstring
regionstring
filterstring
includeAllScopesboolean
maxResultsinteger (uint32)
orderBystring
pageTokenstring
requestIdstring
returnPartialSuccessboolean
serviceProjectNumberstring (int64)

SELECT examples

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
;

INSERT examples

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
;

DELETE examples

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 }}'
;