Google Cloud Platform delete or stop instances without prompt

Viewed 13236

I can use Google compute api to start instances with no problem. I am actually using a script for some light auto-scaling. I boot these instances from a snapshot successfully with no block. However, deleting the instances asks me for confirmation.

gcloud compute instances delete ...

The following instances will be deleted. Attached disks configured to be auto-deleted will be deleted unless they are attached to any other instances. Deleting a disk is irreversible and any data on the disk will be lost. - [xxx-client-1] in [us-central1-f] - [xxx-client-2] in [us-central1-f] - [xxx-client-3] in [us-central1-f]

Do you want to continue (Y/n)? Y

I want to delete without prompt.


I would be ok with stopping the instances, but this seems to fail:

gcloud compute instances stop ...

ERROR: (gcloud.compute.instances) Invalid choice: 'stop'. Did you mean 'list'?

Has 'stop' been changed?

1 Answers
Related