node_groups
Creates, updates, deletes, gets or lists a node_groups resource.
Overview
| Name | node_groups |
| Type | Resource |
| Id | google.compute.node_groups |
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. |
autoscalingPolicy | object | Specifies how autoscaling should behave. (id: NodeGroupAutoscalingPolicy) |
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. |
fingerprint | string (byte) | |
kind | string | Output only. [Output Only] The type of the resource. Alwayscompute#nodeGroup for node group. (default: compute#nodeGroup) |
locationHint | string | An opaque location hint used to place the Node close to other resources. This field is for use by internal tools that use the public API. The location hint here on the NodeGroup overrides any location_hint present in the NodeTemplate. |
maintenanceInterval | string | Specifies the frequency of planned maintenance events. The accepted values are: AS_NEEDED and RECURRENT. (AS_NEEDED, RECURRENT) |
maintenancePolicy | string | Specifies how to handle instances when a node in the group undergoes maintenance. Set to one of: DEFAULT,RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP. The default value is DEFAULT. For more information, see Maintenance policies. (DEFAULT, MAINTENANCE_POLICY_UNSPECIFIED, MIGRATE_WITHIN_NODE_GROUP, RESTART_IN_PLACE) |
maintenanceWindow | object | Time window specified for daily maintenance operations. GCE's internal maintenance will be performed within this window. (id: NodeGroupMaintenanceWindow) |
nodeTemplate | string | URL of the node template to create the node group from. |
selfLink | string | Output only. [Output Only] Server-defined URL for the resource. |
shareSettings | object | Share-settings for the node group (id: ShareSettings) |
size | integer (int32) | Output only. [Output Only] The total number of nodes in the node group. |
status | string | (CREATING, DELETING, INVALID, READY) |
zone | string | Output only. [Output Only] The name of the zone where the node group resides, such as us-central1-a. |
| Name | Datatype | Description |
|---|---|---|
id | string | [Output Only] Unique identifier for the resource; defined by the server. |
items | array | A list of NodeGroup resources. |
kind | string | Output only. [Output Only] Type of resource.Always compute#nodeGroupList for lists of node groups. (default: compute#nodeGroupList) |
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. |
autoscalingPolicy | object | Specifies how autoscaling should behave. (id: NodeGroupAutoscalingPolicy) |
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. |
fingerprint | string (byte) | |
kind | string | Output only. [Output Only] The type of the resource. Alwayscompute#nodeGroup for node group. (default: compute#nodeGroup) |
locationHint | string | An opaque location hint used to place the Node close to other resources. This field is for use by internal tools that use the public API. The location hint here on the NodeGroup overrides any location_hint present in the NodeTemplate. |
maintenanceInterval | string | Specifies the frequency of planned maintenance events. The accepted values are: AS_NEEDED and RECURRENT. (AS_NEEDED, RECURRENT) |
maintenancePolicy | string | Specifies how to handle instances when a node in the group undergoes maintenance. Set to one of: DEFAULT,RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP. The default value is DEFAULT. For more information, see Maintenance policies. (DEFAULT, MAINTENANCE_POLICY_UNSPECIFIED, MIGRATE_WITHIN_NODE_GROUP, RESTART_IN_PLACE) |
maintenanceWindow | object | Time window specified for daily maintenance operations. GCE's internal maintenance will be performed within this window. (id: NodeGroupMaintenanceWindow) |
nodeTemplate | string | URL of the node template to create the node group from. |
selfLink | string | Output only. [Output Only] Server-defined URL for the resource. |
shareSettings | object | Share-settings for the node group (id: ShareSettings) |
size | integer (int32) | Output only. [Output Only] The total number of nodes in the node group. |
status | string | (CREATING, DELETING, INVALID, READY) |
zone | string | Output only. [Output Only] The name of the zone where the node group resides, such as us-central1-a. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | project, zone, nodeGroup | Returns the specified NodeGroup. Get a list of available NodeGroups by making a list() request. Note: the "nodes" field should not be used. Use nodeGroups.listNodes instead. | |
list | select | project, zone | returnPartialSuccess, orderBy, maxResults, pageToken, filter | Retrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group. |
aggregated_list | select | project | maxResults, pageToken, filter, serviceProjectNumber, includeAllScopes, orderBy, returnPartialSuccess | Retrieves an aggregated list of node groups. Note: use nodeGroups.listNodes for more details about each group. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true. |
insert | insert | project, zone, initialNodeCount | requestId | Creates a NodeGroup resource in the specified project using the data included in the request. |
patch | update | project, zone, nodeGroup | requestId | Updates the specified node group. |
delete | delete | project, zone, nodeGroup | requestId | Deletes the specified NodeGroup resource. |
set_node_template | exec | project, zone, nodeGroup | requestId | Updates the node template of the node group. |
perform_maintenance | exec | project, zone, nodeGroup | requestId | Perform maintenance on a subset of nodes in the node group. |
simulate_maintenance_event | exec | project, zone, nodeGroup | requestId | Simulates maintenance event on specified nodes from the node group. |
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 |
|---|---|---|
initialNodeCount | integer (int32) | |
nodeGroup | string | |
project | string | |
zone | 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 NodeGroup. Get a list of available NodeGroups
by making a list() request.
Note: the "nodes" field should not be used. Use nodeGroups.listNodes
instead.
SELECT
id,
name,
autoscalingPolicy,
creationTimestamp,
description,
fingerprint,
kind,
locationHint,
maintenanceInterval,
maintenancePolicy,
maintenanceWindow,
nodeTemplate,
selfLink,
shareSettings,
size,
status,
zone
FROM google.compute.node_groups
WHERE project = '{{ project }}' -- required
AND zone = '{{ zone }}' -- required
AND nodeGroup = '{{ nodeGroup }}' -- required
;
Retrieves a list of node groups available to the specified project.
Note: use nodeGroups.listNodes for more details about each group.
SELECT
id,
items,
kind,
nextPageToken,
selfLink,
warning
FROM google.compute.node_groups
WHERE project = '{{ project }}' -- required
AND zone = '{{ zone }}' -- required
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
AND orderBy = '{{ orderBy }}'
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
;
Retrieves an aggregated list of node groups.
Note: use nodeGroups.listNodes for more details about each group.
To prevent failure, Google recommends that you set thereturnPartialSuccess parameter to true.
SELECT
id,
name,
autoscalingPolicy,
creationTimestamp,
description,
fingerprint,
kind,
locationHint,
maintenanceInterval,
maintenancePolicy,
maintenanceWindow,
nodeTemplate,
selfLink,
shareSettings,
size,
status,
zone
FROM google.compute.node_groups
WHERE project = '{{ project }}' -- required
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND serviceProjectNumber = '{{ serviceProjectNumber }}'
AND includeAllScopes = '{{ includeAllScopes }}'
AND orderBy = '{{ orderBy }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
;
INSERT examples
- insert
- Manifest
Creates a NodeGroup resource in the specified project using the data
included in the request.
INSERT INTO google.compute.node_groups (
data__locationHint,
data__fingerprint,
data__maintenancePolicy,
data__maintenanceWindow,
data__maintenanceInterval,
data__name,
data__autoscalingPolicy,
data__shareSettings,
data__description,
data__nodeTemplate,
project,
zone,
initialNodeCount,
requestId
)
SELECT
'{{ locationHint }}',
'{{ fingerprint }}',
'{{ maintenancePolicy }}',
'{{ maintenanceWindow }}',
'{{ maintenanceInterval }}',
'{{ name }}',
'{{ autoscalingPolicy }}',
'{{ shareSettings }}',
'{{ description }}',
'{{ nodeTemplate }}',
'{{ project }}',
'{{ zone }}',
'{{ initialNodeCount }}',
'{{ 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_groups
props:
- name: project
value: "{{ project }}"
description: Required parameter for the node_groups resource.
- name: zone
value: "{{ zone }}"
description: Required parameter for the node_groups resource.
- name: initialNodeCount
value: "{{ initialNodeCount }}"
description: Required parameter for the node_groups resource.
- name: locationHint
value: "{{ locationHint }}"
description: |
An opaque location hint used to place the Node close to other
resources.
This field is for use by internal tools that use the public API.
The location hint here on the NodeGroup overrides any location_hint
present in the NodeTemplate.
- name: fingerprint
value: "{{ fingerprint }}"
- name: maintenancePolicy
value: "{{ maintenancePolicy }}"
description: |
Specifies how to handle instances when a node in the group undergoes
maintenance. Set to one of: DEFAULT,RESTART_IN_PLACE, or MIGRATE_WITHIN_NODE_GROUP.
The default value is DEFAULT. For more information, see
Maintenance policies.
valid_values: ['DEFAULT', 'MAINTENANCE_POLICY_UNSPECIFIED', 'MIGRATE_WITHIN_NODE_GROUP', 'RESTART_IN_PLACE']
- name: maintenanceWindow
description: |
Time window specified for daily maintenance operations. GCE's internal
maintenance will be performed within this window.
value:
startTime: "{{ startTime }}"
maintenanceDuration:
nanos: {{ nanos }}
seconds: "{{ seconds }}"
- name: maintenanceInterval
value: "{{ maintenanceInterval }}"
description: |
Specifies the frequency of planned maintenance events. The accepted values
are: `AS_NEEDED` and `RECURRENT`.
valid_values: ['AS_NEEDED', 'RECURRENT']
- 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: autoscalingPolicy
description: |
Specifies how autoscaling should behave.
value:
minNodes: {{ minNodes }}
mode: "{{ mode }}"
maxNodes: {{ maxNodes }}
- name: shareSettings
description: |
Share-settings for the node group
value:
shareType: "{{ shareType }}"
projectMap: "{{ projectMap }}"
- name: description
value: "{{ description }}"
description: |
An optional description of this resource. Provide this property when you
create the resource.
- name: nodeTemplate
value: "{{ nodeTemplate }}"
description: |
URL of the node template to create the node group from.
- name: requestId
value: "{{ requestId }}"
UPDATE examples
- patch
Updates the specified node group.
UPDATE google.compute.node_groups
SET
data__locationHint = '{{ locationHint }}',
data__fingerprint = '{{ fingerprint }}',
data__maintenancePolicy = '{{ maintenancePolicy }}',
data__maintenanceWindow = '{{ maintenanceWindow }}',
data__maintenanceInterval = '{{ maintenanceInterval }}',
data__name = '{{ name }}',
data__autoscalingPolicy = '{{ autoscalingPolicy }}',
data__shareSettings = '{{ shareSettings }}',
data__description = '{{ description }}',
data__nodeTemplate = '{{ nodeTemplate }}'
WHERE
project = '{{ project }}' --required
AND zone = '{{ zone }}' --required
AND nodeGroup = '{{ nodeGroup }}' --required
AND requestId = '{{ 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
- delete
Deletes the specified NodeGroup resource.
DELETE FROM google.compute.node_groups
WHERE project = '{{ project }}' --required
AND zone = '{{ zone }}' --required
AND nodeGroup = '{{ nodeGroup }}' --required
AND requestId = '{{ requestId }}'
;
Lifecycle Methods
- set_node_template
- perform_maintenance
- simulate_maintenance_event
Updates the node template of the node group.
EXEC google.compute.node_groups.set_node_template
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@nodeGroup='{{ nodeGroup }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"nodeTemplate": "{{ nodeTemplate }}"
}'
;
Perform maintenance on a subset of nodes in the node group.
EXEC google.compute.node_groups.perform_maintenance
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@nodeGroup='{{ nodeGroup }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"nodes": "{{ nodes }}",
"startTime": "{{ startTime }}"
}'
;
Simulates maintenance event on specified nodes from the node group.
EXEC google.compute.node_groups.simulate_maintenance_event
@project='{{ project }}' --required,
@zone='{{ zone }}' --required,
@nodeGroup='{{ nodeGroup }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"nodes": "{{ nodes }}"
}'
;