Skip to main content

node_groups

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

Overview

Namenode_groups
TypeResource
Idgoogle.compute.node_groups

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.
autoscalingPolicyobjectSpecifies how autoscaling should behave. (id: NodeGroupAutoscalingPolicy)
creationTimestampstring[Output Only] Creation timestamp in RFC3339 text format.
descriptionstringAn optional description of this resource. Provide this property when you create the resource.
fingerprintstring (byte)
kindstring[Output Only] The type of the resource. Always compute#nodeGroup for node group. (default: compute#nodeGroup)
locationHintstringAn 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.
maintenanceIntervalstringSpecifies the frequency of planned maintenance events. The accepted values are: AS_NEEDED and RECURRENT.
maintenancePolicystringSpecifies 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.
maintenanceWindowobjectTime window specified for daily maintenance operations. GCE's internal maintenance will be performed within this window. (id: NodeGroupMaintenanceWindow)
nodeTemplatestringURL of the node template to create the node group from.
selfLinkstring[Output Only] Server-defined URL for the resource.
shareSettingsobjectShare-settings for the node group (id: ShareSettings)
sizeinteger (int32)[Output Only] The total number of nodes in the node group.
statusstring
zonestring[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:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectproject, zone, nodeGroupReturns 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.
listselectproject, zonefilter, maxResults, orderBy, pageToken, returnPartialSuccessRetrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group.
aggregated_listselectprojectfilter, includeAllScopes, maxResults, orderBy, pageToken, returnPartialSuccess, serviceProjectNumberRetrieves 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.
insertinsertproject, zone, initialNodeCountrequestIdCreates a NodeGroup resource in the specified project using the data included in the request.
patchupdateproject, zone, nodeGrouprequestIdUpdates the specified node group.
deletedeleteproject, zone, nodeGrouprequestIdDeletes the specified NodeGroup resource.
set_node_templateexecproject, zone, nodeGrouprequestIdUpdates the node template of the node group.
simulate_maintenance_eventexecproject, zone, nodeGrouprequestIdSimulates maintenance event on specified nodes from the node group.
perform_maintenanceexecproject, zone, nodeGrouprequestIdPerform maintenance on a subset of nodes in 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.

NameDatatypeDescription
initialNodeCountinteger (int32)
nodeGroupstring
projectstring
zonestring
filterstring
includeAllScopesboolean
maxResultsinteger (uint32)
orderBystring
pageTokenstring
requestIdstring
returnPartialSuccessboolean
serviceProjectNumberstring (int64)

SELECT examples

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;

INSERT examples

Creates a NodeGroup resource in the specified project using the data included in the request.

INSERT INTO google.compute.node_groups (
data__kind,
data__id,
data__creationTimestamp,
data__name,
data__description,
data__nodeTemplate,
data__zone,
data__selfLink,
data__status,
data__size,
data__autoscalingPolicy,
data__maintenancePolicy,
data__locationHint,
data__fingerprint,
data__maintenanceWindow,
data__shareSettings,
data__maintenanceInterval,
project,
zone,
initialNodeCount,
requestId
)
SELECT
'{{ kind }}',
'{{ id }}',
'{{ creationTimestamp }}',
'{{ name }}',
'{{ description }}',
'{{ nodeTemplate }}',
'{{ zone }}',
'{{ selfLink }}',
'{{ status }}',
{{ size }},
'{{ autoscalingPolicy }}',
'{{ maintenancePolicy }}',
'{{ locationHint }}',
'{{ fingerprint }}',
'{{ maintenanceWindow }}',
'{{ shareSettings }}',
'{{ maintenanceInterval }}',
'{{ project }}',
'{{ zone }}',
'{{ initialNodeCount }}',
'{{ 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
;

UPDATE examples

Updates the specified node group.

UPDATE google.compute.node_groups
SET
data__kind = '{{ kind }}',
data__id = '{{ id }}',
data__creationTimestamp = '{{ creationTimestamp }}',
data__name = '{{ name }}',
data__description = '{{ description }}',
data__nodeTemplate = '{{ nodeTemplate }}',
data__zone = '{{ zone }}',
data__selfLink = '{{ selfLink }}',
data__status = '{{ status }}',
data__size = {{ size }},
data__autoscalingPolicy = '{{ autoscalingPolicy }}',
data__maintenancePolicy = '{{ maintenancePolicy }}',
data__locationHint = '{{ locationHint }}',
data__fingerprint = '{{ fingerprint }}',
data__maintenanceWindow = '{{ maintenanceWindow }}',
data__shareSettings = '{{ shareSettings }}',
data__maintenanceInterval = '{{ maintenanceInterval }}'
WHERE
project = '{{ project }}' --required
AND zone = '{{ zone }}' --required
AND nodeGroup = '{{ nodeGroup }}' --required
AND requestId = '{{ 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 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

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