Update GCP asset labels

Viewed 266

What is the most efficient way to update all assets labels per project?

I can list all project resources and their labels with gcloud asset search-all-resources --project=SomeProject. The command also returns the labels for those assets.

Is there something like gcloud asset update-labels?

2 Answers

I'm unfamiliar with the service but, APIs Explorer (Google's definitive service documentation), shows a single list method.

I suspect (!?) that you will need to iterate over all your resource types and update instances of them using any (there may not be) update (PATCH) method that permits label changes for that resource type.

This seems like a reasonable request and you may wish to submit a feature request using Google's issue tracker

Related