Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Single setLabels() API to update resource and labels for ALL resources

I'm auto-updating Labels for GCP resources. As I see, I need to call the setLabels() for every resource type which is extremely tedious.

Is there a uber level setLabels() where I can provide resource_id and set it's label instead of worrying about the resource type?

This is how other clouds support it. Wondering whether GCP also has such support?

Solved Solved
1 1 227
1 ACCEPTED SOLUTION

Hi @mdevengine 

Welcome to Google Cloud Community!

As of now there is no "uber level" setLabels() that can be use in the official documentation. You will need to set the resource type to assign the labels to the resources accordingly. For best practices and other information regarding labels please see this link. For additional information on how to apply labels please see this link.

I hope this information is helpful.

If you need further assistance, you can always file a ticket on our support team.



View solution in original post

1 REPLY 1

Hi @mdevengine 

Welcome to Google Cloud Community!

As of now there is no "uber level" setLabels() that can be use in the official documentation. You will need to set the resource type to assign the labels to the resources accordingly. For best practices and other information regarding labels please see this link. For additional information on how to apply labels please see this link.

I hope this information is helpful.

If you need further assistance, you can always file a ticket on our support team.