Method: projects.locations.clusters.list

列出项目在指定位置(区域)或所有位置拥有的所有 Redis 集群。

位置应采用以下格式:

  • projects/{projectId}/locations/{locationId}

如果将 locationId 指定为 -(通配符),则查询项目可用的所有区域,并汇总结果。

HTTP 请求

GET https://redis.googleapis.com/v1alpha1/{parent=projects/*/locations/*}/clusters

网址采用 gRPC 转码语法。

路径参数

参数
parent

string

必需。集群位置的资源名称,格式为 projects/{projectId}/locations/{locationId},其中 locationId 表示 Google Cloud 区域。

查询参数

参数
pageSize

integer

要返回的最大项目数。

如果未指定,则服务将使用默认值 1000。无论 pageSize 值如何,响应都可能包含部分列表,并且调用方应该只依赖于响应的 nextPageToken 来确定是否还有更多集群需要查询。

pageToken

string

从上一个 [clusters.list][CloudRedis.ListClusters] 请求返回的 nextPageToken 值(如果有)。

请求正文

请求正文必须为空。

响应正文

对 [clusters.list][CloudRedis.ListClusters] 的响应。

如果成功,响应正文将包含结构如下的数据:

JSON 表示法
{
  "clusters": [
    {
      object (Cluster)
    }
  ],
  "nextPageToken": string,
  "unreachable": [
    string
  ]
}
字段
clusters[]

object (Cluster)

项目中指定位置或所有位置的 Redis 集群列表。

如果请求的父字段中的 locationId 为“-”,则查询项目可用的所有区域,并汇总结果。如果在此类汇总查询中某个位置不可用,则响应中会包含一个占位 Redis 条目,其中 name 字段设置为 projects/{projectId}/locations/{locationId}/clusters/ 形式的值,status 字段设置为 ERROR,statusMessage 字段设置为“location not available for clusters.list”。

nextPageToken

string

用于检索下一页结果的令牌。如果列表中没有更多结果,则为空。

unreachable[]

string

无法到达的位置。

授权范围

需要以下 OAuth 范围:

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

如需了解详情,请参阅 Authentication Overview