Package google.cloud.location

索引

位置

一種抽象介面,提供服務適用的位置相關資訊。服務專用的中繼資料是透過 Location.metadata 欄位提供。

GetLocation

rpc GetLocation(GetLocationRequest) returns (Location)

取得位置的相關資訊。

授權範圍

需要下列 OAuth 範圍:

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

詳情請參閱Authentication Overview

IAM 權限

需要 name 資源的下列 IAM 權限:

  • observability.locations.get

詳情請參閱 IAM 說明文件

ListLocations

rpc ListLocations(ListLocationsRequest) returns (ListLocationsResponse)

列出這項服務支援位置的相關資訊。

這個方法會根據 ListLocationsRequest.name 欄位中提供的資源範圍列出位置:

  • 全球位置:如果 name 為空白,這個方法會列出所有專案可用的公開位置。
  • 專案專屬位置:如果 name 遵循 projects/{project} 格式,這個方法會列出該特定專案可見的位置。包括專案啟用的公開、私人或其他專案專屬位置。

如果是 gRPC 和用戶端程式庫實作,資源名稱會以 name 欄位傳遞。如果是直接服務呼叫,系統會根據特定服務的實作項目和版本,將資源名稱併入要求路徑。

授權範圍

需要下列 OAuth 範圍:

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

詳情請參閱Authentication Overview

IAM 權限

需要 name 資源的下列 IAM 權限:

  • observability.locations.list

詳情請參閱 IAM 說明文件

GetLocationRequest

Locations.GetLocation 的要求訊息。

欄位
name

string

位置的資源名稱。

ListLocationsRequest

Locations.ListLocations 的要求訊息。

欄位
name

string

擁有位置集合的資源 (如適用)。

filter

string

篩選器,可將結果縮小至偏好的子集。篩選語言接受 "displayName=tokyo" 等字串,詳情請參閱 AIP-160

page_size

int32

要傳回的結果數上限。如未設定,服務會選取預設值。

page_token

string

從回應的 next_page_token 欄位收到的網頁符記。傳送該頁面符記即可接收後續頁面。

extra_location_types[]

string

選用。除非另有明確說明,否則請勿使用這個欄位。這項功能主要供內部使用。

ListLocationsResponse

Locations.ListLocations 的回應訊息。

欄位
locations[]

Location

符合要求中指定篩選器的位置清單。

next_page_token

string

標準清單下一頁符記。

位置

代表 Google Cloud 位置的資源。

欄位
name

string

位置的資源名稱,可以隨不同的實作而改變。範例:"projects/example-project/locations/us-east1"

location_id

string

這個位置的標準 ID,例如 "us-east1"

display_name

string

這個位置的易記名稱,通常是附近的城市名稱,例如「東京」。

labels

map<string, string>

位置的跨服務屬性。例如

{"cloud.googleapis.com/region": "us-east1"}
metadata

Any

服務專用的中繼資料,例如指定位置的可用容量。