Closed rodrigopavan closed 3 years ago
By looking at the docs it appears items[].networkInterfaces[].network
might be what you are looking for.
@codyoss , doens't works...
{ "error": { "code": 400, "message": "Invalid value for field 'filter': 'networkInterfaces[].network=\"https://www.googleapis.com/compute/v1/projects/ns1-ddi-integration-proj-01/global/networks/default\"'. Invalid list filter expression.", "errors": [ { "message": "Invalid value for field 'filter': 'networkInterfaces[].network=\"https://www.googleapis.com/compute/v1/projects/ns1-ddi-integration-proj-01/global/networks/default\"'. Invalid list filter expression.", "domain": "global", "reason": "invalid" } ] } }
{ "error": { "code": 400, "message": "Invalid value for field 'filter': 'items[].networkInterfaces[].network=\"https://www.googleapis.com/compute/v1/projects/ns1-ddi-integration-proj-01/global/networks/default\"'. Invalid list filter expression.", "errors": [ { "message": "Invalid value for field 'filter': 'items[].networkInterfaces[].network=\"https://www.googleapis.com/compute/v1/projects/ns1-ddi-integration-proj-01/global/networks/default\"'. Invalid list filter expression.", "domain": "global", "reason": "invalid" } ] } }
Sorry for the misdirection. If this field could be filtered on you could do it with a :
, see AIP-160 for example syntax. I did also find an open issue related to unable to filter on networkinterfaces though as well: issue. If this is the case the issue is not with this client, but the backend service. I would recommend reaching out for support through one of the methods listed on the compute api support page.
This issue tracker is primarily used for issue relating the the generated code itself.
How can I/It's possible filter instances base on network attribute inside networkInterfaces?
I've tried a few things like:
req := c.ComputeService.Instances.List(projectID, zoneName).Filter('networkInterfaces[0].network=" + networkSelfLink + "')
req := c.ComputeService.Instances.List(projectID, zoneName).Filter('networkInterfaces.network=" + networkSelfLink + "')
But, none of them works, I always receive an:
Invalid value for field 'filter': 'networkInterfaces[0].network="https://www.googleapis.com/compute/v1/projects/simreplicacao/global/networks/default"'. Invalid list filter expression.