2

Using gcloud alpha services It's now perfectly possible to generate keys programatically:

gcloud alpha services api-keys create

I can then enable the Maps JavaScript API using

gcloud services enable maps-backend.googleapis.com

At this point I need to set some HTTP referrer restrictions on that key but the services api-keys update command only updates an API key's metadata.

How do I proceed?

Joe - GMapsBook.com
  • 15,787
  • 4
  • 23
  • 68

1 Answers1

1

It looks (haven't tried the API) as though you can do this at create and update with --allowed-referrers:

https://cloud.google.com/sdk/gcloud/reference/alpha/services/api-keys/create

https://cloud.google.com/sdk/gcloud/reference/alpha/services/api-keys/update

DazWilkin
  • 32,823
  • 5
  • 47
  • 88