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 10 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

If I am understanding this correctly, from the 400 error message you are getting from the server, it seems that the client is doing its job and correctly sending request to service. However, it seems that the service is complaining about the syntax, even though according to doc nested attribute is supported.

Please note that this repo only contains client code and maintainers of this repo are not familiar with the underlying services. 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.

zhumin8 avatar Feb 14 '25 18:02 zhumin8