I am using gcloud python client library (https://github.com/google/google-api-python-client) to get a list of instances. I am able to use filters like name, status but I can't figure out how to filter by IP address (networkIP). I'm sure it has something to do with networkInterfaces being a list, but I can't figure the syntax.
Here's what I think should work:
instance_list = compute.instances().list(
project=project,
zone=zone,
filter='networkInterfaces[0].networkIP eq 10.45.128.6'
).execute()
It returns a HTTP Status 400: "Invalid value for field 'filter'."
What should the filter look like?
Thank you in advance.