Skip to main content

instance_groups_instances

Creates, updates, deletes, gets or lists an instance_groups_instances resource.

Overview

Nameinstance_groups_instances
TypeResource
Idgoogle.compute.instance_groups_instances

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
idstring[Output Only] Unique identifier for the resource; defined by the server.
itemsarrayA list of InstanceWithNamedPorts resources.
kindstringThe resource type. (default: compute#regionInstanceGroupsListInstances)
nextPageTokenstring[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.
selfLinkstring[Output Only] Server-defined URL for this resource.
warningobject[Output Only] Informational warning message.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_instancesselectproject, region, instanceGroupfilter, maxResults, orderBy, pageToken, returnPartialSuccessLists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. The orderBy query parameter is not supported.
add_instancesinsertproject, zone, instanceGrouprequestIdAdds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read Adding instances for more information.
remove_instancesdeleteproject, zone, instanceGrouprequestIdRemoves one or more instances from the specified instance group, but does not delete those instances. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted.

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
instanceGroupstring
projectstring
regionstring
zonestring
filterstring
maxResultsinteger (uint32)
orderBystring
pageTokenstring
requestIdstring
returnPartialSuccessboolean

SELECT examples

Lists the instances in the specified instance group and displays information about the named ports. Depending on the specified options, this method can list all instances or only the instances that are running. The orderBy query parameter is not supported.

SELECT
id,
items,
kind,
nextPageToken,
selfLink,
warning
FROM google.compute.instance_groups_instances
WHERE project = '{{ project }}' -- required
AND region = '{{ region }}' -- required
AND instanceGroup = '{{ instanceGroup }}' -- required
AND filter = '{{ filter }}'
AND maxResults = '{{ maxResults }}'
AND orderBy = '{{ orderBy }}'
AND pageToken = '{{ pageToken }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}';

INSERT examples

Adds a list of instances to the specified instance group. All of the instances in the instance group must be in the same network/subnetwork. Read Adding instances for more information.

INSERT INTO google.compute.instance_groups_instances (
data__instances,
project,
zone,
instanceGroup,
requestId
)
SELECT
'{{ instances }}',
'{{ project }}',
'{{ zone }}',
'{{ instanceGroup }}',
'{{ 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

Removes one or more instances from the specified instance group, but does not delete those instances. If the group is part of a backend service that has enabled connection draining, it can take up to 60 seconds after the connection draining duration before the VM instance is removed or deleted.

DELETE FROM google.compute.instance_groups_instances
WHERE project = '{{ project }}' --required
AND zone = '{{ zone }}' --required
AND instanceGroup = '{{ instanceGroup }}' --required
AND requestId = '{{ requestId }}';