Method: instances.list

Lists instances under a given project.

HTTP request

GET https://sqladmin.googleapis.com/sql/v1beta4/projects/{project}/instances

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
project

string

Project ID of the project for which to list Cloud SQL instances.

Query parameters

Parameters
filter

string

A filter expression that filters resources listed in the response. The expression is in the form of field:value. For example, 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per their JSON representation, such as 'settings.userLabels.auto_start:true'.

Multiple filter queries are space-separated. For example. 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each expression is an AND expression. However, you can include AND and OR expressions explicitly.

maxResults

integer (uint32 format)

The maximum number of instances to return. The service may return fewer than this value. If unspecified, at most 500 instances are returned. The maximum value is 1000; values above 1000 are coerced to 1000.

pageToken

string

A previously-returned page token representing part of the larger set of results to view.

Request body

The request body must be empty.

Response body

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

Database instances list response.

JSON representation
{
  "kind": string,
  "warnings": [
    {
      object (ApiWarning)
    }
  ],
  "items": [
    {
      object (DatabaseInstance)
    }
  ],
  "nextPageToken": string
}
Fields
kind

string

This is always sql#instancesList.

warnings[]

object (ApiWarning)

instances.list of warnings that occurred while handling the request.

items[]

object (DatabaseInstance)

instances.list of database instance resources.

nextPageToken

string

The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/sqlservice.admin

For more information, see the Authentication Overview.

ApiWarning

An Admin API warning message.

JSON representation
{
  "code": enum (SqlApiWarningCode),
  "message": string,
  "region": string
}
Fields
code

enum (SqlApiWarningCode)

Code to uniquely identify the warning type.

message

string

The warning message.

region

string

The region name for REGION_UNREACHABLE warning.

SqlApiWarningCode

Enums
SQL_API_WARNING_CODE_UNSPECIFIED An unknown or unset warning type from Cloud SQL API.
REGION_UNREACHABLE Warning when one or more regions are not reachable. The returned result set may be incomplete.
MAX_RESULTS_EXCEEDS_LIMIT Warning when user provided maxResults parameter exceeds the limit. The returned result set may be incomplete.