Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



Instances: aggregatedList

Requires authorization

Retrieves the list of Instance resources across all available zones. Try it now .

Request

HTTP request

GET https://www.googleapis.com/compute/v1/projects/project/aggregated/instances

Parameters

Parameter name Value Description
Path parameters
project string Project ID of the project scoping this request.
Optional query parameters
filter string Filter expression for filtering listed resources, in the form filter={expression} . Your {expression} must contain the following:
<field_name> <comparison_string> <literal_string>
  • <field_name> : The name of the field you want to compare. The field name must be valid for the type of resource being filtered. Only atomic field types are supported (string, number, boolean). Array and object fields are not currently supported.
  • <comparison_string> : The comparison string, either eq (equals) or ne (not equals).
  • <literal_string> : The literal string value to filter to. The literal value must be valid for the type of field (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax . The literal value must match the entire field. For example, when filtering instances, name eq my_instance won't work, but name eq .*my_instance will work.

For example:

filter=status ne RUNNING

The above filter returns only results whose status field does not equal RUNNING . You can also enclose your literal string in single, double, or no quotes. For example, all three of the following would be valid expressions:

filter=status ne "RUNNING"
filter=status ne 'RUNNING'
filter=status ne RUNNING

If you use a complex regular expression, you need to encode the special characters, including quotes. Consider the following regular expression:

name eq '.*/my_instance_[0-9]+'

To use the expression, you would need to encode it:

filter=name%20eq%20%27.%2A%2Fmy_instance_%5B0-9%5D%2B%27&
maxResults unsigned integer Maximum count of results to be returned. Maximum and default value is 100. Acceptable values are 0 to 500 , inclusive. (Default: 100 )
pageToken string Specifies a nextPageToken returned by a previous list request. This token can be used to request the next page of results from a previous list request.

Authorization

This request requires authorization with at least one of the following scopes ( read more about authentication and authorization ).

Scope
https://www.googleapis.com/auth/compute.readonly
https://www.googleapis.com/auth/compute

Request body

Do not supply a request body with this method.

Response

If successful, this method returns a response body with the following structure:

{
  "kind": "compute#instanceAggregatedList",
  "selfLink": string,
  "id": string,
  "items": {
    (key): {
      "instances": [
        instances Resource
      ],
      "warning": {
        "code": string,
        "message": string,
        "data": [
          {
            "key": string,
            "value": string
          }
        ]
      }
    }
  },
  "nextPageToken": string
}
Property name Value Description Notes
kind string [Ouput Only] Type of resource. Always compute#instanceAggregatedList for an aggregated list of Instance resources.
id string [Output Only] Unique identifier for the resource. This is generated by the server.
items object [Output Only] A map of scoped instance lists.
items. (key) nested object [Output Only] Name of the scope containing this set of instances.
items.(key). instances[] list [Output Only] List of instances contained in this scope.
items.(key). warning object [Output Only] Informational warning which replaces the list of instances when the list is empty.
items.(key).warning. code string [Output Only] The warning type identifier for this warning.

Acceptable values are:
  • " DEPRECATED_RESOURCE_USED ": Indicates that the resource you specified has been deprecated and will eventually be unsupported. We recommend eventually transitioning to a more current resource.
  • " INJECTED_KERNELS_DEPRECATED ": Indicates that specifying a separate Kernel resource is deprecated. You should transition to using images that contain kernel binaries. See Kernels for more information.
  • " NEXT_HOP_ADDRESS_NOT_ASSIGNED ": You did not specify a next hop address for your route.
  • " NEXT_HOP_CANNOT_IP_FORWARD ": In order for your route to work correctly, your source and destination virtual machine instances must have canIpForward enabled. See the documentation for more information.
  • " NEXT_HOP_INSTANCE_NOT_FOUND ": The next hop instance you specified was not found. Please double check that the instance exists and that you have specified it correctly.
  • " NEXT_HOP_INSTANCE_NOT_ON_NETWORK ": The next hop instance you specified was not found on the same network as your route object. Please make sure the instance is part of the same network as your route object.
  • " NEXT_HOP_NOT_RUNNING ": The next hop instance you specified is not currently running. Please restart or create the instnce.
  • " NO_RESULTS_ON_PAGE ": There were no results for your request.
  • " REQUIRED_TOS_AGREEMENT ": You must first agree to the terms of service agreement before you can use this service.
  • " UNREACHABLE ": The Compute Engine service is currently unreachable.
items.(key).warning. message string [Output Only] Optional human-readable details for this warning.
items.(key).warning. data[] list [Output Only] Metadata for this warning in 'key: value' format.
items.(key).warning.data[]. key string [Output Only] A key for the warning data.
items.(key).warning.data[]. value string [Output Only] A warning data value corresponding to the key.
nextPageToken string [Output Only] A token generated by the server if the number of results exceeds the maxResults value. This token can be used to retrieve the next page of results in a separate list request.

Try it!

Use the APIs Explorer below to call this method on live data and see the response.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.