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

List resources without labels

Hi,

I am trying to list resources in a GCP project without any labels.  I am trying to check resources related to support services as documented in https://cloud.google.com/resource-manager/docs/labels-supported-services .

I used the following command, but it lists all assets (the ones with labels as well).

gcloud asset search-all-resources --asset-types=file.googleapis.com.* --filter=-labels.* --project=<project_name>

Any hints please?

Regards

Yogeesh Venkanna

Solved Solved
0 2 2,506
1 ACCEPTED SOLUTION

Hi,

The following command works:

 

 

I will be able to figure out using the above for other asset-types which supports labelling.

 gcloud asset search-all-resources --scope='projects/<project_name>' --asset-types='container.googleapis.com/NodePool' --filter=-labels:*

 

View solution in original post