よく使うgcloudコマンドたち
一般
自分のプロジェクト一覧を表示
gcloud projects list
cloud sdkのプロパティを見る
gcloud config list
プロジェクト切り替え
gcloud config set project <your-project-id>
GCE
インスタンス一覧を見る
gcloud compute instances list
インスタンスの作成(centos-7で)
gcloud compute instances create <your-instance-name> --project <your-project-name> --image-family centos-7
使用可能なimage一覧を見る
gcloud compute images list
インスタンスの起動・停止
gcloud compute instances start <your-instance-name>
gcloud compute instances stop <your-instance-name>
インスタンスにssh
gcloud compute ssh <your-instance-name>
通常のsshコマンドで接続できるように設定
gcloud compute config-ssh
~/.ssh/configに稼働中のインスタンスへの接続設定が作られる。
ssh <your-instance-name>.<zone>.<your-project-id>
ssh [tab]で
インスタンスへローカルのファイルをコピーする
gcloud compute copy-files <local-path> <your-instance-name>:<remote-path> --zone <zone>
インスタンスにあるファイルをローカルにコピーする
gcloud compute copy-files <your-instance-name>:<remote-path> <local-path> --zone <zone>
Author And Source
この問題について(よく使うgcloudコマンドたち), 我々は、より多くの情報をここで見つけました https://qiita.com/masaaania/items/7a83c5e44e351b4a3a2c著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .