Skip to main content

instance_group_managers_instances

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

Overview

Nameinstance_group_managers_instances
TypeResource
Idgoogle.compute.instance_group_managers_instances

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
managedInstancesarrayA list of managed instances.
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.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_managed_instancesselectproject, region, instanceGroupManagerfilter, maxResults, orderBy, pageToken, returnPartialSuccessLists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances. The orderBy query parameter is not supported. The pageToken query parameter is supported only if the group's listManagedInstancesResults field is set to PAGINATED.
create_instancesinsertproject, region, instanceGroupManagerrequestIdCreates instances with per-instance configurations in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method.
delete_instancesdeleteproject, region, instanceGroupManagerrequestIdFlags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method. 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 has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request.

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

SELECT examples

Lists the instances in the managed instance group and instances that are scheduled to be created. The list includes any current actions that the group has scheduled for its instances. The orderBy query parameter is not supported. The pageToken query parameter is supported only if the group's listManagedInstancesResults field is set to PAGINATED.

SELECT
managedInstances,
nextPageToken
FROM google.compute.instance_group_managers_instances
WHERE project = '{{ project }}' -- required
AND region = '{{ region }}' -- required
AND instanceGroupManager = '{{ instanceGroupManager }}' -- required
AND filter = '{{ filter }}'
AND maxResults = '{{ maxResults }}'
AND orderBy = '{{ orderBy }}'
AND pageToken = '{{ pageToken }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}';

INSERT examples

Creates instances with per-instance configurations in this regional managed instance group. Instances are created using the current instance template. The create instances operation is marked DONE if the createInstances request is successful. The underlying actions take additional time. You must separately verify the status of the creating or actions with the listmanagedinstances method.

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

Flags the specified instances in the managed instance group to be immediately deleted. The instances are also removed from any target pools of which they were a member. This method reduces the targetSize of the managed instance group by the number of instances that you delete. The deleteInstances operation is marked DONE if the deleteInstances request is successful. The underlying actions take additional time. You must separately verify the status of the deleting action with the listmanagedinstances method. 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 has elapsed before the VM instance is removed or deleted. You can specify a maximum of 1000 instances with this method per request.

DELETE FROM google.compute.instance_group_managers_instances
WHERE project = '{{ project }}' --required
AND region = '{{ region }}' --required
AND instanceGroupManager = '{{ instanceGroupManager }}' --required
AND requestId = '{{ requestId }}';