「Gcloud」:修訂間差異
跳至導覽
跳至搜尋
第6行: | 第6行: | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
gcloud compute instances create test-by-gslin --zone=asia-east1-a --machine-type=e2-micro --image-project=ubuntu-os-cloud --image-family=ubuntu-2204-lts --tags=allow-whitelist-ssh --network=vpc-default --subnet=subnet-asia-east-1 --private-network-ip=ip-10-143-0-200 --address=eip-test-by-gslin --metadata-from-file ssh-keys=${HOME}/.ssh/example.pub | gcloud compute instances create test-by-gslin --zone=asia-east1-a --machine-type=e2-micro --image-project=ubuntu-os-cloud --image-family=ubuntu-2204-lts --tags=allow-whitelist-ssh --network=vpc-default --subnet=subnet-asia-east-1 --private-network-ip=ip-10-143-0-200 --address=eip-test-by-gslin --metadata-from-file ssh-keys=${HOME}/.ssh/example.pub | ||
</syntaxhighlight> | |||
<syntaxhighlight lang="bash"> | |||
gcloud compute ssh --zone "asia-east1-a" ubuntu@test-by-gslin --project "myproject-123456" --ssh-key-file ~/.ssh/id_rsa | |||
</syntaxhighlight> | </syntaxhighlight> | ||
於 2023年2月24日 (五) 08:27 的修訂
gcloud是GCP的命令列工具。
範例
gcloud compute instances create test-by-gslin --zone=asia-east1-a --machine-type=e2-micro --image-project=ubuntu-os-cloud --image-family=ubuntu-2204-lts --tags=allow-whitelist-ssh --network=vpc-default --subnet=subnet-asia-east-1 --private-network-ip=ip-10-143-0-200 --address=eip-test-by-gslin --metadata-from-file ssh-keys=${HOME}/.ssh/example.pub
gcloud compute ssh --zone "asia-east1-a" ubuntu@test-by-gslin --project "myproject-123456" --ssh-key-file ~/.ssh/id_rsa
gcloud storage buckets list --format=json