instance_groups
Creates, updates, deletes, gets or lists an instance_groups
resource.
Overview
Name | instance_groups |
Type | Resource |
Id | google.compute.instance_groups |
Fields
The following fields are returned by SELECT
queries:
- get
- list
- aggregated_list
Successful response
Name | Datatype | Description |
---|---|---|
id | string (uint64) | [Output Only] A unique identifier for this instance group, generated by the server. |
name | string | The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035. (pattern: a-z?) |
creationTimestamp | string | [Output Only] The creation timestamp for this instance group in RFC3339 text format. |
description | string | An optional description of this resource. Provide this property when you create the resource. |
fingerprint | string (byte) | [Output Only] The fingerprint of the named ports. The system uses this fingerprint to detect conflicts when multiple users change the named ports concurrently. |
kind | string | [Output Only] The resource type, which is always compute#instanceGroup for instance groups. (default: compute#instanceGroup) |
namedPorts | array | Optional. Assigns a name to a port number. For example: {name: "http", port: 80} This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: "app1", port: 8080}, {name: "app1", port: 8081}, {name: "app2", port: 8082}] Named ports apply to all instances in this instance group. |
network | string | [Output Only] The URL of the network to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0). |
region | string | [Output Only] The URL of the region where the instance group is located (for regional resources). |
selfLink | string | [Output Only] The URL for this instance group. The server generates this URL. |
size | integer (int32) | [Output Only] The total number of instances in the instance group. |
subnetwork | string | [Output Only] The URL of the subnetwork to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0). |
zone | string | [Output Only] The URL of the zone where the instance group is located (for zonal resources). |
Successful response
Name | Datatype | Description |
---|---|---|
id | string | [Output Only] Unique identifier for the resource; defined by the server. |
items | array | A list of InstanceGroup resources. |
kind | string | The resource type. (default: compute#regionInstanceGroupList) |
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. |
Successful response
Name | Datatype | Description |
---|---|---|
id | string (uint64) | [Output Only] A unique identifier for this instance group, generated by the server. |
name | string | The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035. (pattern: a-z?) |
creationTimestamp | string | [Output Only] The creation timestamp for this instance group in RFC3339 text format. |
description | string | An optional description of this resource. Provide this property when you create the resource. |
fingerprint | string (byte) | [Output Only] The fingerprint of the named ports. The system uses this fingerprint to detect conflicts when multiple users change the named ports concurrently. |
kind | string | [Output Only] The resource type, which is always compute#instanceGroup for instance groups. (default: compute#instanceGroup) |
namedPorts | array | Optional. Assigns a name to a port number. For example: {name: "http", port: 80} This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: "app1", port: 8080}, {name: "app1", port: 8081}, {name: "app2", port: 8082}] Named ports apply to all instances in this instance group. |
network | string | [Output Only] The URL of the network to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0). |
region | string | [Output Only] The URL of the region where the instance group is located (for regional resources). |
selfLink | string | [Output Only] The URL for this instance group. The server generates this URL. |
size | integer (int32) | [Output Only] The total number of instances in the instance group. |
subnetwork | string | [Output Only] The URL of the subnetwork to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0). |
zone | string | [Output Only] The URL of the zone where the instance group is located (for zonal resources). |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | project , region , instanceGroup | Returns the specified instance group resource. | |
list | select | project , region | filter , maxResults , orderBy , pageToken , returnPartialSuccess | Retrieves the list of instance group resources contained within the specified region. |
aggregated_list | select | project | filter , includeAllScopes , maxResults , orderBy , pageToken , returnPartialSuccess , serviceProjectNumber | Retrieves the list of instance groups and sorts them by zone. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true . |
insert | insert | project , zone | requestId | Creates an instance group in the specified project using the parameters that are included in the request. |
delete | delete | project , zone , instanceGroup | requestId | Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information. |
set_named_ports | exec | project , region , instanceGroup | requestId | Sets the named ports for the specified regional instance group. |
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 | |
includeAllScopes | boolean | |
maxResults | integer (uint32) | |
orderBy | string | |
pageToken | string | |
requestId | string | |
returnPartialSuccess | boolean | |
serviceProjectNumber | string (int64) |
SELECT
examples
- get
- list
- aggregated_list
Returns the specified instance group resource.
SELECT
id,
name,
creationTimestamp,
description,
fingerprint,
kind,
namedPorts,
network,
region,
selfLink,
size,
subnetwork,
zone
FROM google.compute.instance_groups
WHERE project = '{{ project }}' -- required
AND region = '{{ region }}' -- required
AND instanceGroup = '{{ instanceGroup }}' -- required;
Retrieves the list of instance group resources contained within the specified region.
SELECT
id,
items,
kind,
nextPageToken,
selfLink,
warning
FROM google.compute.instance_groups
WHERE project = '{{ project }}' -- required
AND region = '{{ region }}' -- required
AND filter = '{{ filter }}'
AND maxResults = '{{ maxResults }}'
AND orderBy = '{{ orderBy }}'
AND pageToken = '{{ pageToken }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}';
Retrieves the list of instance groups and sorts them by zone. To prevent failure, Google recommends that you set the returnPartialSuccess
parameter to true
.
SELECT
id,
name,
creationTimestamp,
description,
fingerprint,
kind,
namedPorts,
network,
region,
selfLink,
size,
subnetwork,
zone
FROM google.compute.instance_groups
WHERE project = '{{ project }}' -- required
AND filter = '{{ filter }}'
AND includeAllScopes = '{{ includeAllScopes }}'
AND maxResults = '{{ maxResults }}'
AND orderBy = '{{ orderBy }}'
AND pageToken = '{{ pageToken }}'
AND returnPartialSuccess = '{{ returnPartialSuccess }}'
AND serviceProjectNumber = '{{ serviceProjectNumber }}';
INSERT
examples
- insert
- Manifest
Creates an instance group in the specified project using the parameters that are included in the request.
INSERT INTO google.compute.instance_groups (
data__kind,
data__id,
data__creationTimestamp,
data__name,
data__description,
data__namedPorts,
data__network,
data__fingerprint,
data__zone,
data__selfLink,
data__size,
data__region,
data__subnetwork,
project,
zone,
requestId
)
SELECT
'{{ kind }}',
'{{ id }}',
'{{ creationTimestamp }}',
'{{ name }}',
'{{ description }}',
'{{ namedPorts }}',
'{{ network }}',
'{{ fingerprint }}',
'{{ zone }}',
'{{ selfLink }}',
{{ size }},
'{{ region }}',
'{{ subnetwork }}',
'{{ project }}',
'{{ zone }}',
'{{ 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
props:
- name: project
value: string
description: Required parameter for the instance_groups resource.
- name: zone
value: string
description: Required parameter for the instance_groups resource.
- name: kind
value: string
description: >
[Output Only] The resource type, which is always compute#instanceGroup for instance groups.
default: compute#instanceGroup
- name: id
value: string
description: >
[Output Only] A unique identifier for this instance group, generated by the server.
- name: creationTimestamp
value: string
description: >
[Output Only] The creation timestamp for this instance group in RFC3339 text format.
- name: name
value: string
description: >
The name of the instance group. The name must be 1-63 characters long, and comply with RFC1035.
- name: description
value: string
description: >
An optional description of this resource. Provide this property when you create the resource.
- name: namedPorts
value: array
description: >
Optional. Assigns a name to a port number. For example: {name: "http", port: 80} This allows the system to reference ports by the assigned name instead of a port number. Named ports can also contain multiple ports. For example: [{name: "app1", port: 8080}, {name: "app1", port: 8081}, {name: "app2", port: 8082}] Named ports apply to all instances in this instance group.
- name: network
value: string
description: >
[Output Only] The URL of the network to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0).
- name: fingerprint
value: string
description: >
[Output Only] The fingerprint of the named ports. The system uses this fingerprint to detect conflicts when multiple users change the named ports concurrently.
- name: zone
value: string
description: >
[Output Only] The URL of the zone where the instance group is located (for zonal resources).
- name: selfLink
value: string
description: >
[Output Only] The URL for this instance group. The server generates this URL.
- name: size
value: integer
description: >
[Output Only] The total number of instances in the instance group.
- name: region
value: string
description: >
[Output Only] The URL of the region where the instance group is located (for regional resources).
- name: subnetwork
value: string
description: >
[Output Only] The URL of the subnetwork to which all instances in the instance group belong. If your instance has multiple network interfaces, then the network and subnetwork fields only refer to the network and subnet used by your primary interface (nic0).
- name: requestId
value: string
DELETE
examples
- delete
Deletes the specified instance group. The instances in the group are not deleted. Note that instance group must not belong to a backend service. Read Deleting an instance group for more information.
DELETE FROM google.compute.instance_groups
WHERE project = '{{ project }}' --required
AND zone = '{{ zone }}' --required
AND instanceGroup = '{{ instanceGroup }}' --required
AND requestId = '{{ requestId }}';
Lifecycle Methods
- set_named_ports
Sets the named ports for the specified regional instance group.
EXEC google.compute.instance_groups.set_named_ports
@project='{{ project }}' --required,
@region='{{ region }}' --required,
@instanceGroup='{{ instanceGroup }}' --required,
@requestId='{{ requestId }}'
@@json=
'{
"namedPorts": "{{ namedPorts }}",
"fingerprint": "{{ fingerprint }}"
}';