Closed FranckVE closed 2 years ago
What project are you running the code from? APIs will need to be enabled from the calling project. This also seems like a question for the API itself and not these clients which are auto-generated from a spec. If you have further issues I suggest reaching out with one of the options on the Cloud Billing Support Page. Hope that helps
my-fifth-gcp-project
(value set by gcloud config set project my-fifth-gcp-project
and verified by a gcloud config get-value project
)my-fifth-gcp-project
reqToExecute, errNewReq := http.NewRequest("GET", "https://cloudbilling.googleapis.com/v1/projects/"+gcpProjectID+"/billingInfo", nil)
getProjectBillingInfo, errGetBillingInfo := cloudBillingManagerService.Projects.GetBillingInfo("projects/" + gcpProjectID).Do()
).
Projects.GetBillingInfo does not use the specified GCP project (in my case it returned an error because the other GCP project it took in consideration did not have billing enabled).
I had to write a direct call to the Google API using the REST http request, while keeping the Application Default Credentials.
Environment details
Steps to reproduce
It would generate an error because another (other than the one specified in gcpProjectID) more recent project does not have billing enabled.
The problem is that project "123456789" is not the project number of the project specified in gcpProjectID !