How do I create a Google Cloud project that supports the Service Management API?
We deploy our software on behalf of (OAuth2) users to Google Cloud. We've managed to automate most of them, but there isn't much left.
- Project creation is done with https://godoc.org/google.golang.org/api/cloudresourcemanager/v1#ProjectsService.Create
- Enabling the required APIs (compute, storage, etc.) is done with google.golang.org/api/servicemanagement/v1#ServicesService.Enable (cannot be hosted as a complete link due to very striking SO restrictions)
- Instance creation is done with google.golang.org/api/compute/v1#InstancesService.Insert
The missing bit is between steps 1 and 2: in order to use, Service Management API to enable the needed APIs
we need the service management API to be included in the project (ironically). I hope it is possible to create a project from the start with some APIs, perhaps with a cloud resource or perhaps with https://godoc.org/google.golang.org/api/deploymentmanager/v2 , but I am not yet found it.
So, to retell: Does anyone know if it is possible (in Go) to create a Google Cloud project with some specific Google Cloud APIs enabled immediately upon creation?
source to share
Google Cloud Resource Manager API The API is very limited in what it will allow you to do.
while it has a projects.update method , it does not support enabled APIs. You need to manually edit the project.
source to share