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:

NameDatatypeDescription
managedInstancesarrayA list of managed instances.
nextPageTokenstringOutput only. [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger thanmaxResults, 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, instanceGroupManagerreturnPartialSuccess, maxResults, pageToken, filter, orderByLists 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 thecreating or actions with the listmanagedinstances
method.
delete_instancesdeleteproject, region, instanceGroupManagernoGracefulShutdown, requestIdFlags 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 thetargetSize 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 thedeleting action with thelistmanagedinstances
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)
noGracefulShutdownboolean
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 returnPartialSuccess = '{{ returnPartialSuccess }}'
AND maxResults = '{{ maxResults }}'
AND pageToken = '{{ pageToken }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}'
;

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 thecreating 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,
getVersionOperationMetadata,
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 thetargetSize 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 thedeleting action with thelistmanagedinstances
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 noGracefulShutdown = '{{ noGracefulShutdown }}'
AND requestId = '{{ requestId }}'
;