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
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. |
autoscalingPolicy | object | Specifies how autoscaling should behave. (id: NodeGroupAutoscalingPolicy) |
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. |
fingerprint | string (byte) | |
kind | string | [Output Only] The type of the resource. Always compute#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 . |
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. |
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] Server-defined URL for the resource. |
shareSettings | object | Share-settings for the node group (id: ShareSettings) |
size | integer (int32) | [Output Only] The total number of nodes in the node group. |
status | string | |
zone | string | [Output Only] The name of the zone where the node group resides, such as us-central1-a. |
Successful response
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] 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 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. |
autoscalingPolicy | object | Specifies how autoscaling should behave. (id: NodeGroupAutoscalingPolicy) |
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. |
fingerprint | string (byte) | |
kind | string | [Output Only] The type of the resource. Always compute#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 . |
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. |
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] Server-defined URL for the resource. |
shareSettings | object | Share-settings for the node group (id: ShareSettings) |
size | integer (int32) | [Output Only] The total number of nodes in the node group. |
status | string | |
zone | string | [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 | filter , maxResults , orderBy , pageToken , returnPartialSuccess | 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 | filter , includeAllScopes , maxResults , orderBy , pageToken , returnPartialSuccess , serviceProjectNumber | 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. |
simulate_maintenance_event | exec | project , zone , nodeGroup | requestId | Simulates maintenance event on specified nodes from the node group. |
perform_maintenance | exec | project , zone , nodeGroup | requestId | Perform 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.
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 filter = '{{ filter }}'
AND maxResults = '{{ maxResults }}'
AND orderBy = '{{ orderBy }}'
AND pageToken = '{{ pageToken }}'
AND returnPartialSuccess = '{{ 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
.
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 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 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
;
# Description fields are for documentation purposes
- name: node_groups
props:
- name: project
value: string
description: Required parameter for the node_groups resource.
- name: zone
value: string
description: Required parameter for the node_groups resource.
- name: initialNodeCount
value: integer (int32)
description: Required parameter for the node_groups resource.
- name: kind
value: string
description: >
[Output Only] The type of the resource. Always compute#nodeGroup for node group.
default: compute#nodeGroup
- 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: nodeTemplate
value: string
description: >
URL of the node template to create the node group from.
- name: zone
value: string
description: >
[Output Only] The name of the zone where the node group resides, such as us-central1-a.
- name: selfLink
value: string
description: >
[Output Only] Server-defined URL for the resource.
- name: status
value: string
valid_values: ['CREATING', 'DELETING', 'INVALID', 'READY']
- name: size
value: integer
description: >
[Output Only] The total number of nodes in the node group.
- name: autoscalingPolicy
value: object
description: >
Specifies how autoscaling should behave.
- name: maintenancePolicy
value: string
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: locationHint
value: string
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: string
- name: maintenanceWindow
value: object
description: >
Time window specified for daily maintenance operations. GCE's internal maintenance will be performed within this window.
- name: shareSettings
value: object
description: >
Share-settings for the node group
- name: maintenanceInterval
value: string
description: >
Specifies the frequency of planned maintenance events. The accepted values are: `AS_NEEDED` and `RECURRENT`.
valid_values: ['AS_NEEDED', 'RECURRENT']
- name: requestId
value: string
UPDATE
examples
- patch
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
- 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
- simulate_maintenance_event
- perform_maintenance
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 }}"
}';
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 }}"
}';
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 }}"
}';