jeesty
jeesty

Reputation: 1204

On Google Cloud, what is the API method to stop an instance (not the gcutil or manual method)

Mysteriously, there appears to be no documented API call to stop a google cloud instance. In these docs:

https://developers.google.com/compute/docs/instances#stop_job

both the prior and following commands describe API calls to accomplishing, but not the very common task of shutting down an instance.

When I hacked the URL for getting GCE help on 'reseting' an instance, assuming the "delete" command probably existed, I go this valid page:

https://developers.google.com/compute/docs/reference/latest/instances/delete

but this talks about deleting "instance resources" rather than instances themselves. Confusing (to me).

So, is there, or is there not, an API call to shut down a google cloud VM instance?

Upvotes: 1

Views: 306

Answers (1)

Wan B.
Wan B.

Reputation: 18835

Would this be what you are looking for ?

https://developers.google.com/compute/docs/api/python-guide#stoppinganinstance

Python API to stop Google Compute Engine Instance.

This would 'stop' the instance. As deleting an instance is the recommended way to stop an instance.

Upvotes: 1

Related Questions