Method: instanceGroups.addInstances

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.

HTTP request

POST https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{resourceId}/addInstances

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
project

string

Project ID for this request.

zone

string

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

resourceId

string

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

Authorization requires the following IAM permission on the specified resource instanceGroup:

  • compute.instanceGroups.update

Query parameters

Parameters
requestId

string

An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.

For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Request body

The request body contains data with the following structure:

JSON representation
{
  "instances": [
    {
      "instance": string
    }
  ]
}
Fields
instances[]

object

The list of instances to add to the instance group.

instances[].instance

string

The URL for a specific instance. @required compute.instancegroups.addInstances/removeInstances

Authorization requires the following IAM permission on the specified resource instance:

  • compute.instances.use

Response body

If successful, the response body contains data with the following structure:

Represents an Operation resource.

Google Compute Engine has three Operation resources:

You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.

Operations can be global, regional or zonal.

  • For global operations, use the globalOperations resource.
  • For regional operations, use the regionOperations resource.
  • For zonal operations, use the zonalOperations resource.

For more information, read Global, Regional, and Zonal Resources.

JSON representation
{
  "id": string,
  "creationTimestamp": string,
  "name": string,
  "zone": string,
  "clientOperationId": string,
  "operationType": string,
  "targetLink": string,
  "targetId": string,
  "status": enum,
  "statusMessage": string,
  "user": string,
  "progress": integer,
  "insertTime": string,
  "startTime": string,
  "endTime": string,
  "error": {
    "errors": [
      {
        "code": string,
        "location": string,
        "message": string
      }
    ]
  },
  "warnings": [
    {
      "code": enum,
      "message": string,
      "data": [
        {
          "key": string,
          "value":