I'd like to start/stop/restart VMs in GCP through scripts. There are OAuth2.0 and API key methods for this.
For OAuth 2.0, I can generate access token through "gcloud auth print-access-token" I get the key and it works.
I want to the same to work with API keys, but not able to find API key for "Compute Engine", there are service account, but keys.
curl --request POST \ 'https://www.googleapis.com/compute/v1/projects/xxxx/zones/xxx/instances/xxx/stop?key=[YOUR_API_KEY]' \ --header 'Accept: application/json' \ --compressed
what I am missing?
thanks.