POST
/
v1
/
queryHistories:search
{
  "queryHistories": [
    {
      "name": "<string>",
      "database": "<string>",
      "creator": "<string>",
      "createTime": "2023-11-07T05:31:56Z",
      "statement": "<string>",
      "error": "<string>",
      "duration": "<string>",
      "type": "TYPE_UNSPECIFIED"
    }
  ],
  "nextPageToken": "<string>"
}

Body

application/json
pageSize
integer

The maximum number of histories to return. The service may return fewer than this value. If unspecified, at most 10 history entries will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

pageToken
string

A page token, received from a previous ListQueryHistory call. Provide this to retrieve the subsequent page.

filter
string

Filter is the filter to apply on the search query history The syntax and semantics of CEL are documented at https://github.com/google/cel-spec

Supported filter:

  • project: the project full name in "projects/{id}" format, support "==" operator.
  • database: the database full name in "instances/{id}/databases/{name}" format, support "==" operator.
  • instance: the instance full name in "instances/{id}" format, support "==" operator.
  • type: the type, should be "QUERY" or "EXPORT", support "==" operator.
  • statement: the SQL statemnt, support ".matches()" operator.

For example: project == "projects/{project}" database == "instances/{instance}/databases/{database}" instance == "instances/{instance}" type == "QUERY" type == "EXPORT" statement.matches("select") type == "QUERY" && statement.matches("select")

Response

OK

queryHistories
object[]

The list of history.

nextPageToken
string

A token to retrieve next page of history. Pass this value in the page_token field in the subsequent call to ListQueryHistory method to retrieve the next page of history.