instance_group_managers_instances
Creates, updates, deletes, gets or lists an instance_group_managers_instances resource.
Overview
| Name | instance_group_managers_instances |
| Type | Resource |
| Id | google.compute.instance_group_managers_instances |
Fields
The following fields are returned by SELECT queries:
- list_managed_instances
| Name | Datatype | Description |
|---|---|---|
managedInstances | array | A list of managed instances. |
nextPageToken | string | Output 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list_managed_instances | select | project, region, instanceGroupManager | returnPartialSuccess, maxResults, pageToken, filter, orderBy | 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 issupported only if the group's listManagedInstancesResults field is setto PAGINATED. |
create_instances | insert | project, region, instanceGroupManager | requestId | 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. |
delete_instances | delete | project, region, instanceGroupManager | noGracefulShutdown, requestId | 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. |
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 |
|---|---|---|
instanceGroupManager | string | |
project | string | |
region | string | |
filter | string | |
maxResults | integer (uint32) | |
noGracefulShutdown | boolean | |
orderBy | string | |
pageToken | string | |
requestId | string | |
returnPartialSuccess | boolean |
SELECT examples
- list_managed_instances
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
- create_instances
- Manifest
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
;
# Description fields are for documentation purposes
- name: instance_group_managers_instances
props:
- name: project
value: "{{ project }}"
description: Required parameter for the instance_group_managers_instances resource.
- name: region
value: "{{ region }}"
description: Required parameter for the instance_group_managers_instances resource.
- name: instanceGroupManager
value: "{{ instanceGroupManager }}"
description: Required parameter for the instance_group_managers_instances resource.
- name: instances
description: |
[Required] List of specifications of per-instance configs.
value:
- name: "{{ name }}"
status: "{{ status }}"
preservedState:
disks: "{{ disks }}"
internalIPs: "{{ internalIPs }}"
metadata: "{{ metadata }}"
externalIPs: "{{ externalIPs }}"
fingerprint: "{{ fingerprint }}"
- name: requestId
value: "{{ requestId }}"
DELETE examples
- delete_instances
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 }}'
;