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:

Successful response

NameDatatypeDescription
idstring (uint64)[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 with RFC1035. 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.
creationTimestampstring[Output Only] Creation timestamp in RFC3339 text format.
descriptionstringAn optional description of this resource. Provide this property when you create the resource.
disksarray
kindstring[Output Only] The type of the resource. Always compute#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)
regionstring[Output Only] The name of the region where the node template resides, such as us-central1.
selfLinkstring[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)
statusstring[Output Only] The status of the node template. One of the following values: CREATING, READY, and DELETING.
statusMessagestring[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, regionfilter, maxResults, orderBy, pageToken, returnPartialSuccessRetrieves a list of node templates available to the specified project.
aggregated_listselectprojectfilter, includeAllScopes, maxResults, orderBy, pageToken, returnPartialSuccess, serviceProjectNumberRetrieves 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__kind,
data__id,
data__creationTimestamp,
data__name,
data__description,
data__nodeType,
data__nodeAffinityLabels,
data__status,
data__statusMessage,
data__region,
data__selfLink,
data__nodeTypeFlexibility,
data__serverBinding,
data__disks,
data__accelerators,
data__cpuOvercommitType,
project,
region,
requestId
)
SELECT
'{{ kind }}',
'{{ id }}',
'{{ creationTimestamp }}',
'{{ name }}',
'{{ description }}',
'{{ nodeType }}',
'{{ nodeAffinityLabels }}',
'{{ status }}',
'{{ statusMessage }}',
'{{ region }}',
'{{ selfLink }}',
'{{ nodeTypeFlexibility }}',
'{{ serverBinding }}',
'{{ disks }}',
'{{ accelerators }}',
'{{ cpuOvercommitType }}',
'{{ project }}',
'{{ region }}',
'{{ 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
;

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