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