class InstanceGroups extends Resource (View source)

The "instanceGroups" collection of methods.

Typical usage is:

 $computeService = new Google\Service\Compute(...);
 $instanceGroups = $computeService->instanceGroups;

Methods

addInstances(string $project, string $zone, string $instanceGroup, InstanceGroupsAddInstancesRequest $postBody, array $optParams = [])

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. (instanceGroups.addInstances)

aggregatedList(string $project, array $optParams = [])

Retrieves the list of instance groups and sorts them by zone. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true. (instanceGroups.aggregatedList)

delete(string $project, string $zone, string $instanceGroup, array $optParams = [])

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. (instanceGroups.delete)

get(string $project, string $zone, string $instanceGroup, array $optParams = [])

Returns the specified zonal instance group. Get a list of available zonal instance groups by making a list() request. For managed instance groups, use the instanceGroupManagers or regionInstanceGroupManagers methods instead.

insert(string $project, string $zone, InstanceGroup $postBody, array $optParams = [])

Creates an instance group in the specified project using the parameters that are included in the request. (instanceGroups.insert)

listInstanceGroups(string $project, string $zone, array $optParams = [])

Retrieves the list of zonal instance group resources contained within the specified zone. For managed instance groups, use the instanceGroupManagers or regionInstanceGroupManagers methods instead.

listInstances(string $project, string $zone, string $instanceGroup, InstanceGroupsListInstancesRequest $postBody, array $optParams = [])

Lists the instances in the specified instance group. The orderBy query parameter is not supported. The filter query parameter is supported, but only for expressions that use eq (equal) or ne (not equal) operators.

removeInstances(string $project, string $zone, string $instanceGroup, InstanceGroupsRemoveInstancesRequest $postBody, array $optParams = [])

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.

setNamedPorts(string $project, string $zone, string $instanceGroup, InstanceGroupsSetNamedPortsRequest $postBody, array $optParams = [])

Sets the named ports for the specified instance group.

Details

Operation addInstances(string $project, string $zone, string $instanceGroup, InstanceGroupsAddInstancesRequest $postBody, array $optParams = [])

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. (instanceGroups.addInstances)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone where the instance group is located.

string $instanceGroup

The name of the instance group where you are adding instances.

InstanceGroupsAddInstancesRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

InstanceGroupAggregatedList aggregatedList(string $project, array $optParams = [])

Retrieves the list of instance groups and sorts them by zone. To prevent failure, Google recommends that you set the returnPartialSuccess parameter to true. (instanceGroups.aggregatedList)

Parameters

string $project

Project ID for this request.

array $optParams

Optional parameters.

Return Value

InstanceGroupAggregatedList

Exceptions

Exception

Operation delete(string $project, string $zone, string $instanceGroup, array $optParams = [])

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. (instanceGroups.delete)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone where the instance group is located.

string $instanceGroup

The name of the instance group to delete.

array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

InstanceGroup get(string $project, string $zone, string $instanceGroup, array $optParams = [])

Returns the specified zonal instance group. Get a list of available zonal instance groups by making a list() request. For managed instance groups, use the instanceGroupManagers or regionInstanceGroupManagers methods instead.

(instanceGroups.get)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone where the instance group is located.

string $instanceGroup

The name of the instance group.

array $optParams

Optional parameters.

Return Value

InstanceGroup

Exceptions

Exception

Operation insert(string $project, string $zone, InstanceGroup $postBody, array $optParams = [])

Creates an instance group in the specified project using the parameters that are included in the request. (instanceGroups.insert)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone where you want to create the instance group.

InstanceGroup $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

InstanceGroupList listInstanceGroups(string $project, string $zone, array $optParams = [])

Retrieves the list of zonal instance group resources contained within the specified zone. For managed instance groups, use the instanceGroupManagers or regionInstanceGroupManagers methods instead.

(instanceGroups.listInstanceGroups)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone where the instance group is located.

array $optParams

Optional parameters.

Return Value

InstanceGroupList

Exceptions

Exception

InstanceGroupsListInstances listInstances(string $project, string $zone, string $instanceGroup, InstanceGroupsListInstancesRequest $postBody, array $optParams = [])

Lists the instances in the specified instance group. The orderBy query parameter is not supported. The filter query parameter is supported, but only for expressions that use eq (equal) or ne (not equal) operators.

(instanceGroups.listInstances)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone where the instance group is located.

string $instanceGroup

The name of the instance group from which you want to generate a list of included instances.

InstanceGroupsListInstancesRequest $postBody
array $optParams

Optional parameters.

Return Value

InstanceGroupsListInstances

Exceptions

Exception

Operation removeInstances(string $project, string $zone, string $instanceGroup, InstanceGroupsRemoveInstancesRequest $postBody, array $optParams = [])

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.

(instanceGroups.removeInstances)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone where the instance group is located.

string $instanceGroup

The name of the instance group where the specified instances will be removed.

InstanceGroupsRemoveInstancesRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception

Operation setNamedPorts(string $project, string $zone, string $instanceGroup, InstanceGroupsSetNamedPortsRequest $postBody, array $optParams = [])

Sets the named ports for the specified instance group.

(instanceGroups.setNamedPorts)

Parameters

string $project

Project ID for this request.

string $zone

The name of the zone where the instance group is located.

string $instanceGroup

The name of the instance group where the named ports are updated.

InstanceGroupsSetNamedPortsRequest $postBody
array $optParams

Optional parameters.

Return Value

Operation

Exceptions

Exception