instance_groups_instances
Creates, updates, deletes, gets or lists an instance_groups_instances
resource.
Overview
Name | instance_groups_instances |
Type | Resource |
Id | google.compute.instance_groups_instances |
Fields
The following fields are returned by SELECT
queries:
- list_instances
Successful response
Name | Datatype | Description |
---|---|---|
id | string | [Output Only] Unique identifier for the resource; defined by the server. |
items | array | A list of InstanceWithNamedPorts resources. |
kind | string | The resource type. (default: compute#regionInstanceGroupsListInstances) |
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. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
list_instances | select | project , region , instanceGroup | filter , maxResults , orderBy , pageToken , returnPartialSuccess | 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. |
add_instances | insert | project , zone , instanceGroup | requestId | 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. |
remove_instances | delete | project , zone , instanceGroup | requestId | 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. |
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 |
---|---|---|
instanceGroup | string | |
project | string | |
region | string | |
zone | string | |
filter | string | |
maxResults | integer (uint32) | |
orderBy | string | |
pageToken | string | |
requestId | string | |
returnPartialSuccess | boolean |
SELECT
examples
- list_instances
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
- add_instances
- Manifest
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
;
# Description fields are for documentation purposes
- name: instance_groups_instances
props:
- name: project
value: string
description: Required parameter for the instance_groups_instances resource.
- name: zone
value: string
description: Required parameter for the instance_groups_instances resource.
- name: instanceGroup
value: string
description: Required parameter for the instance_groups_instances resource.
- name: instances
value: array
description: >
The list of instances to add to the instance group.
- name: requestId
value: string
DELETE
examples
- remove_instances
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 }}';