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

NameDatatypeDescription
idstring[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.
descriptionstringAn optional description of this resource. Provide this property when you create the resource.
autoscalingPolicyobject
creationTimestampstring[Output Only] Creation timestamp in RFC3339 text format.
fingerprintstring
kindstring[Output Only] The type of the resource. Always compute#nodeGroup for node group.
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.
nodeTemplatestringURL of the node template to create the node group from.
selfLinkstring[Output Only] Server-defined URL for the resource.
shareSettingsobjectThe share setting for reservations and sole tenancy node groups.
sizeinteger[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

NameAccessible byRequired ParamsDescription
aggregated_listSELECTprojectRetrieves 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.
getSELECTnodeGroup, project, zoneReturns 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, zoneRetrieves a list of node groups available to the specified project. Note: use nodeGroups.listNodes for more details about each group.
insertINSERTinitialNodeCount, project, zoneCreates a NodeGroup resource in the specified project using the data included in the request.
deleteDELETEnodeGroup, project, zoneDeletes the specified NodeGroup resource.
patchUPDATEnodeGroup, project, zoneUpdates the specified node group.
perform_maintenanceEXECnodeGroup, project, zonePerform maintenance on a subset of nodes in the node group.
set_node_templateEXECnodeGroup, project, zoneUpdates the node template of the node group.
simulate_maintenance_eventEXECnodeGroup, project, zoneSimulates maintenance event on specified nodes from the node group.

SELECT examples

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.

SELECT
id,
name,
description,
autoscalingPolicy,
creationTimestamp,
fingerprint,
kind,
locationHint,
maintenanceInterval,
maintenancePolicy,
maintenanceWindow,
nodeTemplate,
selfLink,
shareSettings,
size,
status,
zone
FROM google.compute.node_groups
WHERE project = '{{ project }}';

INSERT example

Use the following StackQL query and manifest file to create a new node_groups resource.

/*+ create */
INSERT INTO google.compute.node_groups (
initialNodeCount,
project,
zone,
name,
description,
nodeTemplate,
zone,
status,
size,
autoscalingPolicy,
maintenancePolicy,
locationHint,
fingerprint,
maintenanceWindow,
shareSettings,
maintenanceInterval
)
SELECT
'{{ initialNodeCount }}',
'{{ project }}',
'{{ zone }}',
'{{ name }}',
'{{ description }}',
'{{ nodeTemplate }}',
'{{ zone }}',
'{{ status }}',
'{{ size }}',
'{{ autoscalingPolicy }}',
'{{ maintenancePolicy }}',
'{{ locationHint }}',
'{{ fingerprint }}',
'{{ maintenanceWindow }}',
'{{ shareSettings }}',
'{{ maintenanceInterval }}'
;

UPDATE example

Updates a node_groups resource.

/*+ update */
UPDATE google.compute.node_groups
SET
name = '{{ name }}',
description = '{{ description }}',
nodeTemplate = '{{ nodeTemplate }}',
zone = '{{ zone }}',
status = '{{ status }}',
size = '{{ size }}',
autoscalingPolicy = '{{ autoscalingPolicy }}',
maintenancePolicy = '{{ maintenancePolicy }}',
locationHint = '{{ locationHint }}',
fingerprint = '{{ fingerprint }}',
maintenanceWindow = '{{ maintenanceWindow }}',
shareSettings = '{{ shareSettings }}',
maintenanceInterval = '{{ maintenanceInterval }}'
WHERE
nodeGroup = '{{ nodeGroup }}'
AND project = '{{ project }}'
AND zone = '{{ zone }}';

DELETE example

Deletes the specified node_groups resource.

/*+ delete */
DELETE FROM google.compute.node_groups
WHERE nodeGroup = '{{ nodeGroup }}'
AND project = '{{ project }}'
AND zone = '{{ zone }}';