Google 云资产 assets.list REST API 已返回配额超出错误

Google cloud asset assets.list REST API Quota exceeded error returned

我正在尝试使用来自 我的代码 的云资产清单 assets.list REST API 请求,在达到最大配额后我收到以下错误:“消费者 'project_number:ProjectNumber' 的服务 'cloudasset.googleapis.com' 的配额指标 'ListAssets Requests' 和限制 'ListAssets Requests per minute' 超出配额”,其中我获得的项目编号与我的项目的项目 ID 匹配,我可以另请参阅 Cloud Asset API.

中报价选项卡下的请求

然而,当我在“https://cloud.google.com/asset-inventory/docs/reference/rest/v1/assets/list”中使用“尝试此方法”时,超出了配额限制我getthe same quota error 但有一些我不认识的 ProjectNumber(与我的项目的 project-id 不匹配)而且我也看不到在引号选项卡下提出的请求。

如果您能解释一下在使用第二种方法时我得到一个我不认识的项目编号的原因,我将不胜感激?谁拥有这个项目编号?

当您使用“试试这个方法”时,您正在利用一个 Google-owned 项目。

Google-owned 项目是支持 APIs Explorer 的项目 s “尝试此方法”(OAuth2) 客户端和启用所有 Google API 的项目。

当您使用 gcloud auth application-default 时,gcloud 使用了类似的方法,尽管我认为这是一个不同的项目。

在这两种情况下,将它们视为 Google(不是您的)应用程序,并且与任何需要凭据的(!)应用程序一样,在这些情况下,Google 必须提供一个项目启用 OAuth2 并启用适当的 API。

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.