Method: regionInstanceGroupManagers.patch

Updates a managed instance group using the information that you specify in the request. This operation is marked as DONE when the group is patched even if the instances in the group are still in the process of being patched. You must separately verify the status of the individual instances with the listmanagedinstances method. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.

HTTP request

PATCH https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}/instanceGroupManagers/{resourceId}

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
project

string

Project ID for this request.

region

string

Name of the region scoping this request.

resourceId

string

The name of the instance group manager.

Authorization requires one or more of the following IAM permissions on the specified resource instanceGroupManager:

  • compute.instanceGroupManagers.get
  • compute.instanceGroupManagers.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
{
  "id": string,
  "creationTimestamp": string,
  "name": string,
  "description": string,
  "zone": string,
  "region": string,
  "distributionPolicy": {
    "zones": [
      {
        "zone": string
      }
    ],
    "targetShape": enum
  },
  "instanceTemplate": string,
  "versions": [
    {
      "name": string,
      "instanceTemplate": string,
      "targetSize": {
        "fixed": integer,
        "percent": integer,
        "calculated": integer
      }
    }
  ],
  "instanceGroup": string,
  "targetPools": [
    string
  ],
  "baseInstanceName": string,
  "fingerprint": string,
  "currentActions": {
    "none": integer,
    "creating": integer,
    "creatingWithoutRetries": integer,
    "verifying": integer,
    "recreating": integer,
    "deleting": integer,
    "abandoning": integer,
    "restarting": integer,
    "refreshing": integer
  },
  "status": {
    "isStable": boolean,
    "versionTarget": {
      "isReached": boolean
    },
    "stateful": {
      "hasStatefulConfig": boolean,
      "perInstanceConfigs": {
        "allEffective": boolean
      }
    },
    "autoscaler": string
  },
  "targetSize": integer,
  "selfLink": string,
  "autoHealingPolicies": [
    {
      "healthCheck": string,
      "initialDelaySec": integer
    }
  ],
  "updatePolicy": {
    "type": enum,
    "instanceRedistributionType": enum,
    "minimalAction": enum,
    "maxSurge": {
      "fixed": integer,
      "percent": integer,
      "calculated": integer
    },
    "maxUnavailable": {
      "fixed": integer,
      "percent": integer,
      "calculated": integer
    },
    "replacementMethod": enum
  },
  "namedPorts": [
    {
      "name": string,
      "port": integer
    }
  ],
  "statefulPolicy": {
    "preservedState": {
      "disks": {
        string: {
          "autoDelete": enum
        },
        ...
      }
    }
  },
  "kind": string
}
Fields
id

string (uint64 format)

[Output Only] A unique identifier for this resource type. The server generates this identifier.

creationTimestamp

string

[Output Only] The creation timestamp for this managed instance group in RFC3339 text format.

name

string

The name of the managed instance group. The name must be 1-63 characters long, and comply with RFC1035.

description

string

An optional description of this resource.

zone

string

[Output Only] The URL of a zone where the managed instance group is located (for zonal resources).

region

string

[Output Only] The URL of the region where the managed instance group resides (for regional resources).

distributionPolicy

object

Policy specifying the intended distribution of managed instances across zones in a regional managed instance group.

distributionPolicy.zones[]

object

Zones where the regional managed instance group will create and manage its instances.

distributionPolicy.zones[].zone

string

The URL of the zone. The zone must exist in the region where the managed instance group is located.

distributionPolicy.targetShape

enum

The distribution shape to which the group converges either proactively or on resize events (depending on the value set in updatePolicy.instanceRedistributionType).

instanceTemplate

string

The URL of the instance template that is specified for this managed instance group. The group uses this template to create all new instances in the managed instance group. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE.

Authorization requires one or more of the following IAM permissions on the specified resource instanceTemplate:

  • compute.instanceTemplates.get
  • compute.instanceTemplates.useReadOnly
versions[]

object

Specifies the instance templates used by this managed instance group to create instances.

Each version is defined by an instanceTemplate and a name. Every version can appear at most once per instance group. This field overrides the top-level instanceTemplate field. Read more about the relationships between these fields. Exactly one version must leave the targetSize field unset. That version will be applied to all remaining instances. For more information, read about canary updates.

versions[].name

string

Name of the version. Unique among all versions in the scope of this managed instance group.

versions[].instanceTemplate

string

The URL of the instance template that is specified for this managed instance group. The group uses this template to create new instances in the managed instance group until the targetSize for this version is reached. The templates for existing instances in the group do not change unless you run recreateInstances, run applyUpdatesToInstances, or set the group's updatePolicy.type to PROACTIVE; in those cases, existing instances are updated until the targetSize for this version is reached.

Authorization requires one or more of the following IAM permissions on the specified resource instanceTemplate:

  • compute.instanceTemplates.get
  • compute.instanceTemplates.useReadOnly
versions[].targetSize

object

Specifies the intended number of instances to be created from the instanceTemplate. The final number of instances created from the template will be equal to:

  • If expressed as a fixed number, the minimum of either targetSize.fixed or instanceGroupManager.targetSize is used.
  • if expressed as a percent, the targetSize would be (targetSize.percent/100 * InstanceGroupManager.targetSize) If there is a remainder, the number is rounded.
If unset, this version will update any remaining instances not updated by another version. Read Starting a canary update for more information.

versions[].targetSize.fixed

integer

Specifies a fixed number of VM instances. This must be a positive integer.

versions[].targetSize.percent

integer

Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.

versions[].targetSize.calculated

integer

[Output Only] Absolute value of VM instances calculated based on the specific mode.

  • If the value is fixed, then the calculated value is equal to the fixed value.
  • If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded.
instanceGroup

string

[Output Only] The URL of the Instance Group resource.

targetPools[]

string

The