Reputation: 289
It seems that the method instances.list in Compute Engine API doesn't support filtering with metadata in REST.
When using the filter : metadata.items.key['user'][value]='test-user'
I get Invalid value for field 'filter': 'metadata.items.key['user'][value]='test-user''. Invalid list filter expression.
.
However it seems that this is possible using gcloud, see : Stackoverflow thread
Upvotes: 0
Views: 1582
Reputation: 638
I tested this by first running the gcloud command:
$gcloud compute instances list --filter="metadata.items.key['user']['value']='test-user'"
The gcloud command worked successfully; however, when I tried doing the samething using the API, I received the same error as you.
From researching further, I was able to find this Stackoverflow case which matches this issue.
There seems to be an internal issue with the Rest API. I would also suggest filing a public issue tracker in regards to this issue. You can submit a public issue tracker by clicking here.
Upvotes: 2