Within Google Cloud I want to be able to get a list of any entity (Compute, storage, whatever) that matches a given key:value label without having to go to each entity in turn and I would like a list of every entity where a given key is NOT present. Any ideas?
Hello @martinthom ,
Welcome to Google Cloud Community!
It would be great if we could see the exact commands and the exact results, that would likely be useful. You can also be a bit specific with the steps that youāre going through when and if you encounter any failure.
Donāt hesitate to post back here with any questions. We are delighted to try and help. Thanks!
Hello Willbin.
Thanks for your reply.
Iām using the Console UI to navigate so there are no ācommandsā as such. Maybe Iām unaware of commands that would do what I want?
My goal is to make sure that as many of our resources as possible are labelled so that we can trace costs with more granularity. I am using one label.key with various label.values. It would help me (ideally in the UI but could do command line) to get a page of links to all the resource that are labelled with ākeyā but also to those that are not labelled with ākeyā so that I can then click through and label them.
I also need to find all places where I made a mistake and labelled them with key:value1 when it should have been key:value2.
Hence the request for a page that lists all entities that match (1) key, (2) value, (3) key:value and to also be able to use NOT to negate these three.
And, yeah, the ideal result from that filter would be a clickable list of links to those entities (be they VMs, IP addresses, Clusters whatever - anything that can take a label).
Does that make sense?
MT
Hello @martinthom ,
Thanks for the detailed info.
As I understand this, you must enable Cloud Key Management Service (KMS) API in order to use labels with other Google Cloud resources.
You can use this document to create, update and remove key labels.
Willbin,
Even if I stick to the resources that I can currently label Iām still looking to get a list of entities that have (or donāt have) a label across resources.
How do I do that?
Thanks.
Martin