- HTTP request
- Path parameters
- Query parameters
- Request body
- Response body
- Authorization Scopes
- Examples
- Try it!
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.
HTTP request
POST https://compute.googleapis.com/compute/v1/projects/{project}/zones/{zone}/instanceGroupManagers/{resourceId}/listManagedInstances
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
project |
Project ID for this request. |
zone |
The name of the zone where the managed instance group is located. |
resourceId |
The name of the managed instance group. Authorization requires the following IAM permission on the specified resource
|
Query parameters
Parameters | |
---|---|
maxResults |
The maximum number of results per page that should be returned. If the number of available results is larger than |
pageToken |
Specifies a page token to use. Set |
filter |
A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either For example, if you are filtering Compute Engine instances, you can exclude instances named You can also filter nested fields. For example, you could specify To filter on multiple expressions, provide each separate expression within parentheses. For example:
By default, each expression is an
|
orderBy |
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 Currently, only sorting by |
returnPartialSuccess |
Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today. |
Request body
The request body must be empty.
Response body
If successful, the response body contains data with the following structure:
JSON representation | |
---|---|
{ "managedInstances": [ { "instance": string, "id": string, "instanceStatus": enum, "version": { "name": string, "instanceTemplate": string }, "preservedStateFromPolicy": { "disks": { string: { "source": string, "mode": enum, "autoDelete": enum }, ... }, "metadata": { string: string, ... } }, "preservedStateFromConfig": { "disks": { string: { "source": string, "mode": enum, "autoDelete": enum }, ... }, "metadata": { string: string, ... } }, "currentAction": enum, "instanceHealth": [ { "healthCheck": string, "detailedHealthState": enum } ], "lastAttempt": { "errors": { "errors": [ { "code": string, "location": string, "message": string } ] } } } ], "nextPageToken": string } |
Fields | |
---|---|
managedInstances[] |
[Output Only] The list of instances in the managed instance group. |
managedInstances[].instance |
[Output Only] The URL of the instance. The URL can exist even if the instance has not yet been created. |
managedInstances[].id |
[Output only] The unique identifier for this resource. This field is empty when instance does not exist. |
managedInstances[].instanceStatus |
[Output Only] The status of the instance. This field is empty when the instance does not exist. |
managedInstances[].version |
[Output Only] Intended version of this instance. |
managedInstances[].version.name |
[Output Only] Name of the version. |
managedInstances[].version.instanceTemplate |
[Output Only] The intended template of the instance. This field is empty when currentAction is one of { DELETING, ABANDONING }. |
managedInstances[].preservedStateFromPolicy |
[Output Only] Preserved state generated based on stateful policy for this instance. |
managedInstances[].preservedStateFromPolicy.disks[] |
Preserved disks defined for this instance. This map is keyed with the device names of the disks. An object containing a list of |
managedInstances[].preservedStateFromPolicy.disks[].source |
The URL of the disk resource that is stateful and should be attached to the VM instance. |
managedInstances[].preservedStateFromPolicy.disks[].mode |
The mode in which to attach this disk, either |
managedInstances[].preservedStateFromPolicy.disks[].autoDelete |
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 |
managedInstances[].preservedStateFromPolicy.metadata |
Preserved metadata defined for this instance. An object containing a list of |
managedInstances[].preservedStateFromConfig |
[Output Only] Preserved state applied from per-instance config for this instance. |
managedInstances[].preservedStateFromConfig.disks[] |
Preserved disks defined for this instance. This map is keyed with the device names of the disks. An object containing a list of |
managedInstances[].preservedStateFromConfig.disks[].source |
The URL of the disk resource that is stateful and should be attached to the VM instance. |
managedInstances[].preservedStateFromConfig.disks[].mode |
The mode in which to attach this disk, either |
managedInstances[].preservedStateFromConfig.disks[].autoDelete |
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 |
managedInstances[].preservedStateFromConfig.metadata |
Preserved metadata defined for this instance. An object containing a list of |
managedInstances[].currentAction |
[Output Only] The current action that the managed instance group has scheduled for the instance. Possible values:
|
managedInstances[].instanceHealth[] |
[Output Only] Health state of the instance per health-check. |
managedInstances[].instanceHealth[].healthCheck |
[Output Only] The URL for the health check that verifies whether the instance is healthy. |
managedInstances[].instanceHealth[].detailedHealthState |
[Output Only] The current detailed instance health state. |
managedInstances[].lastAttempt |
[Output Only] Information about the last attempt to create or delete the instance. |
managedInstances[].lastAttempt.errors |
[Output Only] Encountered errors during the last attempt to create or delete the instance. |
managedInstances[].lastAttempt.errors.errors[] |
[Output Only] The array of errors encountered while processing this operation. |
managedInstances[].lastAttempt.errors.errors[].code |
[Output Only] The error type identifier for this error. |
managedInstances[].lastAttempt.errors.errors[].location |
[Output Only] Indicates the field in the request that caused the error. This property is optional. |
managedInstances[].lastAttempt.errors.errors[].message |
[Output Only] An optional, human-readable error message. |
nextPageToken |
[Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than |
Authorization Scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/compute
https://www.googleapis.com/auth/cloud-platform
For more information, see the Authentication Overview.