跳至主要内容

[GCP] Google Cloud SDK

所有 gcloud 指令 @ google cloud

安裝 SDK

Installing Google Cloud SDK @ Google Cloud

初始化 SDK

Initializing Cloud SDK @ Google Cloud

# 登入 google cloud
$ gcloud auth login

# 設定要使用的專案
$ gcloud config set project PROJECT_ID

# 檢視 sdk 使用者
$ gcloud auth list

# 切換 active user
$ gcloud config set account aaronchen@jubo.health
$ gcloud config set account `ACCOUNT`
$ gcloud config list

Async

使用 --async 可以讓該指令在背景執行,執行後會得到 OPERATION-ID,後續可以用這個 ID 來查執行的結果:

$ gcloud compute operations describe [OPERATION-ID]