简体   繁体   中英

Why does the cloudasset.googleapis.com API not list storage buckets?

When running

gcloud asset search-all-resources --scope=projects/my-project

I get resources listed from many Google APIs: container.googleapis.com, compute.googleapis.com, cloudresourcemanager.googleapis.com, iam.googleapis.com and more

What's missing, though, are my storage buckets. According to https://cloud.google.com/asset-inventory/docs/supported-asset-types storage buckets are supported and should therefore be shown.

I also checked the REST API. Same result, though. My buckets are of course shown via gsutil ls -p my-project and on the cloud console.

Does anyone have an idea what's going on here?


Side note: According to https://cloud.google.com/asset-inventory/docs/getting-support , I should use the tag google-cloud-asset-inventory for questions about this API. That tag, however, doesn't exist yet and I unfortunately can't create it myself.

Found what the problem is. It's actually documented here: https://cloud.google.com/asset-inventory/docs/supported-asset-types

Note: These resource types are supported by the export and monitor services. For types supported by the search service, see searchable asset types. For types supported by the analysis service, see analyzable asset types.

So, the problem is that the REST API returns just a subset of the resources. And many resources are only supported in the export. I tried it out and everything shows up in the export. Including the buckets.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM