Hide
Google Compute Engine

GlobalOperations: list

Requires authorization

Retrieves the list of operation resources contained within the specified project. Try it now.

Request

HTTP request

GET https://www.googleapis.com/compute/beta/projects/project/global/operations

Parameters

Parameter name Value Description
Path parameters
project string Project ID for 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 500. Acceptable values are 0 to 500, inclusive. (Default: 500)
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
https://www.googleapis.com/auth/cloud-platform

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#operationList",
  "id": string,
  "items": [
    globalOperations Resource
  ],
  "nextPageToken": string,
  "selfLink": string
}
Property name Value Description Notes
kind string [Output Only] Type of resource. Always compute#operations for Operations resource.
id string [Output Only] Unique identifier for the resource; defined by the server.
items[] list [Output Only] The operation resources.
nextPageToken string [Output Only] A token used to continue a truncate.

Try it!

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