Method: instanceGroupManagers.listManagedInstances

Lists all of the instances in the managed instance group. Each instance in the list has a currentAction, which indicates the action that the managed instance group is performing on the instance. For example, if the group is still creating an instance, the currentAction is CREATING. If a previous action failed, the list displays the errors for that failed action. The orderBy query parameter is not supported. The pageToken query parameter is supported only if the group's listManagedInstancesResults field is set to PAGINATED.

HTTP request

POST https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{instanceGroupManager}/listManagedInstances

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 managed instance group is located.

instanceGroupManager

string

The name of the managed instance group.

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

  • compute.instanceGroupManagers.get

Query parameters

Parameters
maxResults

integer (uint32 format)

The maximum number of results per page that should be returned. If the number of available results is larger than maxResults, Compute Engine returns a nextPageToken that can be used to get the next page of results in subsequent list requests. Acceptable values are 0 to 500, inclusive. (Default: 500)

pageToken

string

Specifies a page token to use. Set pageToken to the nextPageToken returned by a previous list request to get the next page of results.

filter

string

A filter expression that filters resources listed in the response. Most Compute resources support two types of filter expressions: expressions that support regular expressions and expressions that follow API improvement proposal AIP-160. These two types of filter expressions cannot be mixed in one request.

If you want to use AIP-160, your expression must specify the field name, an operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The operator must be either =, !=, >, <, <=, >= or :.

For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance.

The :* comparison can be used to test whether a key has been defined. For example, to find all objects with owner label use:

labels.owner:*

You can also filter nested fields. For example, you could specify scheduling.automaticRestart = false to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.

To filter on multiple expressions, provide each separate expression within parentheses. For example:

(scheduling.automaticRestart = true)
(cpuPlatform = "Intel Skylake")

By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly. For example:

(cpuPlatform = "Intel Skylake") OR
(cpuPlatform = "Intel Broadwell") AND
(scheduling.automaticRestart = true)

If you want to use a regular expression, use the eq (equal) or ne (not equal) operator against a single un-parenthesized expression with or without quotes or against multiple parenthesized expressions. Examples:

fieldname eq unquoted literal fieldname eq 'single quoted literal' fieldname eq "double quoted literal" (fieldname1 eq literal) (fieldname2 ne "literal")

The literal value is interpreted as a regular expression using Google RE2 library syntax. The literal value must match the entire field.

For example, to filter for instances that do not end with name "instance", you would use name ne .*instance.

You cannot combine constraints on multiple fields using regular expressions.

orderBy

string

Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.

You can also sort results in descending order based on the creation timestamp using orderBy="creationTimestamp desc". This sorts results based on the creationTimestamp field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.

Currently, only sorting by name or creationTimestamp desc is supported.

returnPartialSuccess

boolean

Opt-in for partial success behavior which provides partial results in case of failure. The default value is false.

For example, when partial success behavior is enabled, aggregatedList for a single zone scope either returns all resources in the zone or no resources, with an error code.

Request body

The request body must be empty.

Response body

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

JSON representation
{
  "managedInstances": [
    {
      "name": string,
      "instance": string,
      "id": string,
      "instanceStatus": enum,
      "version": {
        "name": string,
        "instanceTemplate": string
      },
      "preservedStateFromPolicy": {
        "disks": {
          string: {
            "source": string,
            "mode": enum,
            "autoDelete": enum
          },
          ...
        },
        "metadata": {
          string: string,
          ...
        },
        "internalIPs": {
          string: {
            "autoDelete": enum,
            "ipAddress": {
              "literal": string,
              "address": string
            }
          },
          ...
        },
        "externalIPs": {
          string: {
            "autoDelete": enum,
            "ipAddress": {
              "literal": string,
              "address": string
            }
          },
          ...
        }
      },
      "preservedStateFromConfig": {
        "disks": {
          string: {
            "source": string,
            "mode": enum,
            "autoDelete": enum
          },
          ...
        },
        "metadata": {
          string: string,
          ...
        },
        "internalIPs": {
          string: {
            "autoDelete": enum,
            "ipAddress": {
              "literal": string,
              "address": string
            }
          },
          ...
        },
        "externalIPs": {
          string: {
            "autoDelete": enum,
            "ipAddress": {
              "literal": string,
              "address": string
            }
          },
          ...
        }
      },
      "currentAction": enum,
      "instanceHealth": [
        {
          "healthCheck": string,
          "detailedHealthState": enum
        }
      ],
      "lastAttempt": {
        "errors": {
          "errors": [
            {
              "code": string,
              "location": string,
              "message": string,
              "errorDetails": [
                {
                  "errorInfo": {
                    "reason": string,
                    "domain": string,
                    "metadatas": {
                      string: string,
                      ...
                    }
                  },
                  "quotaInfo": {
                    "metricName": string,
                    "limitName": string,
                    "dimensions": {
                      string: string,
                      ...
                    },
                    "limit": number,
                    "futureLimit": number,
                    "rolloutStatus": enum
                  },
                  "help": {
                    "links": [
                      {
                        "description": string,
                        "url": string
                      }
                    ]
                  },
                  "localizedMessage": {
                    "locale": string,
                    "message": string
                  }
                }
              ]
            }
          ]
        }
      }
    }
  ],
  "nextPageToken": string
}
Fields
managedInstances[]

object

[Output Only] The list of instances in the managed instance group.

managedInstances[].name

string

[Output Only] The name of the instance. The name always exists even if the instance has not yet been created.

managedInstances[].instance

string

[Output Only] The URL of the instance. The URL can exist even if the instance has not yet been created.

managedInstances[].id

string (uint64 format)

[Output only] The unique identifier for this resource. This field is empty when instance does not exist.

managedInstances[].instanceStatus

enum

[Output Only] The status of the instance. This field is empty when the instance does not exist.

managedInstances[].version

object

[Output Only] Intended version of this instance.

managedInstances[].version.name

string

[Output Only] Name of the version.

managedInstances[].version.instanceTemplate

string

[Output Only] The intended template of the instance. This field is empty when currentAction is one of { DELETING, ABANDONING }.

managedInstances[].preservedStateFromPolicy

object

[Output Only] Preserved state generated based on stateful policy for this instance.

managedInstances[].preservedStateFromPolicy.disks[]

map (key: string, value: object)

Preserved disks defined for this instance. This map is keyed with the device names of the disks.

managedInstances[].preservedStateFromPolicy.disks[].source

string

The URL of the disk resource that is stateful and should be attached to the VM instance.

managedInstances[].preservedStateFromPolicy.disks[].mode

enum

The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.

managedInstances[].preservedStateFromPolicy.disks[].autoDelete

enum

These stateful disks will never be deleted during autohealing, update, instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole MIG is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted.

managedInstances[].preservedStateFromPolicy.metadata

map (key: string, value: string)

Preserved metadata defined for this instance.

managedInstances[].preservedStateFromPolicy.internalIPs[]

map (key: string, value: object)

Preserved internal IPs defined for this instance. This map is keyed with the name of the network interface.

managedInstances[].preservedStateFromPolicy.internalIPs[].autoDelete

enum

These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted.

managedInstances[].preservedStateFromPolicy.internalIPs[].ipAddress

object

Ip address representation

managedInstances[].preservedStateFromPolicy.internalIPs[].ipAddress.literal

string

An IPv4 internal network address to assign to the instance for this network interface.

managedInstances[].preservedStateFromPolicy.internalIPs[].ipAddress.address

string

The URL of the reservation for this IP address.

managedInstances[].preservedStateFromPolicy.externalIPs[]

map (key: string, value: object)

Preserved external IPs defined for this instance. This map is keyed with the name of the network interface.

managedInstances[].preservedStateFromPolicy.externalIPs[].autoDelete

enum

These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted.

managedInstances[].preservedStateFromPolicy.externalIPs[].ipAddress

object

Ip address representation

managedInstances[].preservedStateFromPolicy.externalIPs[].ipAddress.literal

string

An IPv4 internal network address to assign to the instance for this network interface.

managedInstances[].preservedStateFromPolicy.externalIPs[].ipAddress.address

string

The URL of the reservation for this IP address.

managedInstances[].preservedStateFromConfig

object

[Output Only] Preserved state applied from per-instance config for this instance.

managedInstances[].preservedStateFromConfig.disks[]

map (key: string, value: object)

Preserved disks defined for this instance. This map is keyed with the device names of the disks.

managedInstances[].preservedStateFromConfig.disks[].source

string

The URL of the disk resource that is stateful and should be attached to the VM instance.

managedInstances[].preservedStateFromConfig.disks[].mode

enum

The mode in which to attach this disk, either READ_WRITE or READ_ONLY. If not specified, the default is to attach the disk in READ_WRITE mode.

managedInstances[].preservedStateFromConfig.disks[].autoDelete

enum

These stateful disks will never be deleted during autohealing, update, instance recreate operations. This flag is used to configure if the disk should be deleted after it is no longer used by the group, e.g. when the given instance or the whole MIG is deleted. Note: disks attached in READ_ONLY mode cannot be auto-deleted.

managedInstances[].preservedStateFromConfig.metadata

map (key: string, value: string)

Preserved metadata defined for this instance.

managedInstances[].preservedStateFromConfig.internalIPs[]

map (key: string, value: object)

Preserved internal IPs defined for this instance. This map is keyed with the name of the network interface.

managedInstances[].preservedStateFromConfig.internalIPs[].autoDelete

enum

These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted.

managedInstances[].preservedStateFromConfig.internalIPs[].ipAddress

object

Ip address representation

managedInstances[].preservedStateFromConfig.internalIPs[].ipAddress.literal

string

An IPv4 internal network address to assign to the instance for this network interface.

managedInstances[].preservedStateFromConfig.internalIPs[].ipAddress.address

string

The URL of the reservation for this IP address.

managedInstances[].preservedStateFromConfig.externalIPs[]

map (key: string, value: object)

Preserved external IPs defined for this instance. This map is keyed with the name of the network interface.

managedInstances[].preservedStateFromConfig.externalIPs[].autoDelete

enum

These stateful IPs will never be released during autohealing, update or VM instance recreate operations. This flag is used to configure if the IP reservation should be deleted after it is no longer used by the group, e.g. when the given instance or the whole group is deleted.

managedInstances[].preservedStateFromConfig.externalIPs[].ipAddress

object

Ip address representation

managedInstances[].preservedStateFromConfig.externalIPs[].ipAddress.literal

string

An IPv4 internal network address to assign to the instance for this network interface.

managedInstances[].preservedStateFromConfig.externalIPs[].ipAddress.address

string

The URL of the reservation for this IP address.

managedInstances[].currentAction

enum

[Output Only] The current action that the managed instance group has scheduled for the instance. Possible values:

  • NONE The instance is running, and the managed instance group does not have any scheduled actions for this instance.
  • CREATING The managed instance group is creating this instance. If the group fails to create this instance, it will try again until it is successful.
  • CREATING_WITHOUT_RETRIES The managed instance group is attempting to create this instance only once. If the group fails to create this instance, it does not try again and the group's targetSize value is decreased instead.
  • RECREATING The managed instance group is recreating this instance.
  • DELETING The managed instance group is permanently deleting this instance.
  • ABANDONING The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group.
  • RESTARTING The managed instance group is restarting the instance.
  • REFRESHING The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance.
  • VERIFYING The managed instance group has created the instance and it is in the process of being verified.

managedInstances[].instanceHealth[]

object

[Output Only] Health state of the instance per health-check.

managedInstances[].instanceHealth[].healthCheck

string

[Output Only] The URL for the health check that verifies whether the instance is healthy.

managedInstances[].instanceHealth[].detailedHealthState

enum

[Output Only] The current detailed instance health state.

managedInstances[].lastAttempt

object

[Output Only] Information about the last attempt to create or delete the instance.

managedInstances[].lastAttempt.errors

object

[Output Only] Encountered errors during the last attempt to create or delete the instance.

managedInstances[].lastAttempt.errors.errors[]

object

[Output Only] The array of errors encountered while processing this operation.

managedInstances[].lastAttempt.errors.errors[].code

string

[Output Only] The error type identifier for this error.

managedInstances[].lastAttempt.errors.errors[].location

string

[Output Only] Indicates the field in the request that caused the error. This property is optional.

managedInstances[].lastAttempt.errors.errors[].message

string

[Output Only] An optional, human-readable error message.

managedInstances[].lastAttempt.errors.errors[].errorDetails[]

object

[Output Only] An optional list of messages that contain the error details. There is a set of defined message types to use for providing details.The syntax depends on the error code. For example, QuotaExceededInfo will have details when the error code is QUOTA_EXCEEDED.

managedInstances[].lastAttempt.errors.errors[].errorDetails[].errorInfo

object

managedInstances[].lastAttempt.errors.errors[].errorDetails[].errorInfo.reason

string

The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within a particular domain of errors. This should be at most 63 characters and match a regular expression of [A-Z][A-Z0-9_]+[A-Z0-9], which represents UPPER_SNAKE_CASE.

managedInstances[].lastAttempt.errors.errors[].errorDetails[].errorInfo.domain

string

The logical grouping to which the "reason" belongs. The error domain is typically the registered service name of the tool or product that generates the error. Example: "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain must be a globally unique value that identifies the infrastructure. For Google API infrastructure, the error domain is "googleapis.com".

managedInstances[].lastAttempt.errors.errors[].errorDetails[].errorInfo.metadatas

map (key: string, value: string)

Additional structured details about this error.

Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in length. When identifying the current value of an exceeded limit, the units should be contained in the key, not the value. For example, rather than {"instanceLimit": "100/request"}, should be returned as, {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be created in a single (batch) request.

managedInstances[].lastAttempt.errors.errors[].errorDetails[].quotaInfo

object

managedInstances[].lastAttempt.errors.errors[].errorDetails[].quotaInfo.metricName

string

The Compute Engine quota metric name.

managedInstances[].lastAttempt.errors.errors[].errorDetails[].quotaInfo.limitName

string

The name of the quota limit.

managedInstances[].lastAttempt.errors.errors[].errorDetails[].quotaInfo.dimensions

map (key: string, value: string)

The map holding related quota dimensions.

managedInstances[].lastAttempt.errors.errors[].errorDetails[].quotaInfo.limit

number

Current effective quota limit. The limit's unit depends on the quota type or metric.

managedInstances[].lastAttempt.errors.errors[].errorDetails[].quotaInfo.futureLimit

number

Future quota limit being rolled out. The limit's unit depends on the quota type or metric.

managedInstances[].lastAttempt.errors.errors[].errorDetails[].quotaInfo.rolloutStatus

enum

Rollout status of the future quota limit.

managedInstances[].lastAttempt.errors.errors[].errorDetails[].help

object

managedInstances[].lastAttempt.errors.errors[].errorDetails[].help.links[]

object

URL(s) pointing to additional information on handling the current error.

managedInstances[].lastAttempt.errors.errors[].errorDetails[].help.links[].description

string

Describes what the link offers.

managedInstances[].lastAttempt.errors.errors[].errorDetails[].help.links[].url

string

The URL of the link.

managedInstances[].lastAttempt.errors.errors[].errorDetails[].localizedMessage

object

managedInstances[].lastAttempt.errors.errors[].errorDetails[].localizedMessage.locale

string

The locale used following the specification defined at https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: "en-US", "fr-CH", "es-MX"

managedInstances[].lastAttempt.errors.errors[].errorDetails[].localizedMessage.message

string

The localized error message in the above locale.

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.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/compute.readonly
  • https://www.googleapis.com/auth/compute
  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.