以编程方式删除 google 个实例
delete google instance programatically
我正在使用命令:
gcloud compute instances delete instance1 --zone="europe-west1-c"
The following instances will be deleted. Any attached disks configured
to be auto-deleted will be deleted unless they are attached to any
other instances or the `--keep-disks` flag is given and specifies them
for keeping. Deleting a disk is irreversible and any data on the disk
will be lost.
- [instance1] in [europe-west1-c]
Do you want to continue (Y/n)?
它要求交互模式 Y/N 但我希望该命令是非交互的,所以代码可以在没有任何交互的情况下工作,我在 google doc 上没有找到任何东西。
使用 -q 或 --quiet 标志
gcloud compute instances delete instance1 --zone="europe-west1-c" -q
我正在使用命令:
gcloud compute instances delete instance1 --zone="europe-west1-c"
The following instances will be deleted. Any attached disks configured
to be auto-deleted will be deleted unless they are attached to any
other instances or the `--keep-disks` flag is given and specifies them
for keeping. Deleting a disk is irreversible and any data on the disk
will be lost.
- [instance1] in [europe-west1-c]
Do you want to continue (Y/n)?
它要求交互模式 Y/N 但我希望该命令是非交互的,所以代码可以在没有任何交互的情况下工作,我在 google doc 上没有找到任何东西。
使用 -q 或 --quiet 标志
gcloud compute instances delete instance1 --zone="europe-west1-c" -q