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
Successful response
Name | Datatype | Description |
---|---|---|
id | string (uint64) | [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 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. |
accelerators | array | |
cpuOvercommitType | string | CPU overcommit. |
creationTimestamp | string | [Output Only] Creation timestamp in RFC3339 text format. |
description | string | An optional description of this resource. Provide this property when you create the resource. |
disks | array | |
kind | string | [Output Only] The type of the resource. Always compute#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] The name of the region where the node template resides, such as us-central1. |
selfLink | string | [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] The status of the node template. One of the following values: CREATING, READY, and DELETING. |
statusMessage | string | [Output Only] An optional, human-readable explanation of the status. |
Successful response
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] 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 than maxResults, 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] Server-defined URL for this resource. |
warning | object | [Output Only] Informational warning message. |
Successful response
Name | Datatype | Description |
---|---|---|
id | string (uint64) | [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 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. |
accelerators | array | |
cpuOvercommitType | string | CPU overcommit. |
creationTimestamp | string | [Output Only] Creation timestamp in RFC3339 text format. |
description | string | An optional description of this resource. Provide this property when you create the resource. |
disks | array | |
kind | string | [Output Only] The type of the resource. Always compute#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] The name of the region where the node template resides, such as us-central1. |
selfLink | string | [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] The status of the node template. One of the following values: CREATING, READY, and DELETING. |
statusMessage | string | [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 | filter , maxResults , orderBy , pageToken , returnPartialSuccess | Retrieves a list of node templates available to the specified project. |
aggregated_list | select | project | filter , includeAllScopes , maxResults , orderBy , pageToken , returnPartialSuccess , serviceProjectNumber | 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 filter = '{{ filter }}'
AND maxResults = '{{ maxResults }}'
AND orderBy = '{{ orderBy }}'
AND pageToken = '{{ pageToken }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}';
Retrieves an aggregated list of node templates. To prevent failure, Google recommends that you set the returnPartialSuccess
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 filter = '{{ filter }}'
AND includeAllScopes = '{{ includeAllScopes }}'
AND maxResults = '{{ maxResults }}'
AND orderBy = '{{ orderBy }}'
AND pageToken = '{{ pageToken }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
AND serviceProjectNumber = '{{ serviceProjectNumber }}';
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__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
;
# Description fields are for documentation purposes
- name: node_templates
props:
- name: project
value: string
description: Required parameter for the node_templates resource.
- name: region
value: string
description: Required parameter for the node_templates resource.
- name: kind
value: string
description: >
[Output Only] The type of the resource. Always compute#nodeTemplate for node templates.
default: compute#nodeTemplate
- name: id
value: string
description: >
[Output Only] The unique identifier for the resource. This identifier is defined by the server.
- name: creationTimestamp
value: string
description: >
[Output Only] Creation timestamp in RFC3339 text format.
- name: name
value: string
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 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.
- name: description
value: string
description: >
An optional description of this resource. Provide this property when you create the resource.
- name: nodeType
value: string
description: >
The node type to use for nodes group that are created from this template.
- name: nodeAffinityLabels
value: object
description: >
Labels to use for node affinity, which will be used in instance scheduling.
- name: status
value: string
description: >
[Output Only] The status of the node template. One of the following values: CREATING, READY, and DELETING.
valid_values: ['CREATING', 'DELETING', 'INVALID', 'READY']
- name: statusMessage
value: string
description: >
[Output Only] An optional, human-readable explanation of the status.
- name: region
value: string
description: >
[Output Only] The name of the region where the node template resides, such as us-central1.
- name: selfLink
value: string
description: >
[Output Only] Server-defined URL for the resource.
- name: nodeTypeFlexibility
value: object
description: >
Do not use. Instead, use the node_type property.
- name: serverBinding
value: object
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.
- name: disks
value: array
- name: accelerators
value: array
- name: cpuOvercommitType
value: string
description: >
CPU overcommit.
valid_values: ['CPU_OVERCOMMIT_TYPE_UNSPECIFIED', 'ENABLED', 'NONE']
- name: requestId
value: string
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 }}';