google-cloud-java icon indicating copy to clipboard operation
google-cloud-java copied to clipboard

[compute] filtering on nested attributes does not work

Open artem-mindrov opened this issue 8 months ago • 1 comments

Thanks for stopping by to let us know something could be better!

PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.

Please run down the following list and make sure you've tried the usual "quick fixes":

  • Search the issues already opened: https://github.com/googleapis/google-cloud-java/issues
  • Check for answers on StackOverflow: http://stackoverflow.com/questions/tagged/google-cloud-platform

If you are still having issues, please include as much information as possible:

Environment details

  1. Specify the API at the beginning of the title. For example, "[vision]: ..."). General, Core, and Other are also allowed as types
  2. OS type and version: MacOS Sonoma 14.7.2
  3. Java version: 17 temurin
  4. Version(s): 1.67.0

Steps to reproduce

  1. This code:
            try (RegionBackendServicesClient rbsc = RegionBackendServicesClient.create()) {
              Set<String> backendServices =
                  rbsc.list(
                          ListRegionBackendServicesRequest.newBuilder()
                              .setProject("yugabyte-cloud-dev")
                              .setRegion("us-west1")
                              .setFilter("backends.group:2qs566tttzgpvhl7kga3kal23i")
                              .build())
                      .getPage()
                      .streamValues()
                      .map(BackendService::getName)
                      .collect(Collectors.toSet());
            }

throws a 400:

Invalid value for field 'filter': 'backends.group:2qs566tttzgpvhl7kga3kal23i'. Invalid list filter expression.
  1. The same filter using gcloud works:
gcloud compute backend-services list --filter="backends.group:2qs566tttzgpvhl7kga3kal23i"
NAME                           BACKENDS                                                               PROTOCOL
lb-2qs566tttzgpvhl7kga3kal23i  us-west1-a/instanceGroups/yb-cloud-c-2qs566tttzgpvhl7kga3kal23i-n1-ig  TCP

Code example

See above

Stack trace

Any relevant stacktrace here.

External references such as API reference guides

  • ?

Any additional information below

Following these steps guarantees the quickest resolution possible.

Thanks!

artem-mindrov avatar Feb 11 '25 01:02 artem-mindrov