I'm trying to use cloud asset inventory assets.list REST API request from my code and after reaching the maximum quota I get the following error: "Quota exceeded for quota metric 'ListAssets Requests' and limit 'ListAssets Requests per minute' of service 'cloudasset.googleapis.com' for consumer 'project_number:ProjectNumber'" where the ProjectNumber I get match the project-id of my project and I can also see the requests made under the quotes tab in Cloud Asset API.
However When I'm using the "Try this method" in "https://cloud.google.com/asset-inventory/docs/reference/rest/v1/assets/list" above the quota limit I getthe same quota error but with some ProjectNumber I don't recognize (doesn't match the project-id of my project) and I also can't see the requests made under the quotes tab.
I would appreciate an explanation of the reason I get a project number I don't recognize when using the second method? who own this project number?
CodePudding user response:
When you use "Try this method", you're leveraging a Google-owned project.
The Google-owned project is the one that backs the APIs Explorer s "Try this method" (OAuth2) client and the project that has all Google's APIs enabled.
A similar approach is used by gcloud
when you use gcloud auth application-default
though I assume it's a different project.
In both cases, think of these as Google (not your) applications and, as with any (!) application that requires credentials, in these cases, Google must provide a project that enables OAuth2 and enables the appropriate APIs.
NOTE This mechanism helps explain why, sometimes when using either of these Google applications, the user may find "Service X is not enabled [for project ...]". In this case, Google has not enabled the API in the backing project and so the developer is unable to use it.