5 Replies Latest reply on Aug 21, 2020 4:03 PM by Francisco Flores

    Has anyone been able to get aliases to work using BQUERY?

    Matthew Ragland
      Share This:

      Referring to this document:
      https://docs.bmc.com/docs/ServerAutomation/89/uri-syntax-examples-653398863.htmlQuerying on a condition - Documentation for BMC Server Automation 8.9 - BMC Documentation

       

      There is a section called "Using aliases" and no matter what syntax I use, I cannot seem to be able to get this to work (even using the example bmc gives)

       

       

      Attempt #1:

      blcli_execute get "/query?BQUERY=SELECT s.ip_address, d.name FROM SystemObject/Server s, SystemObject/Depot Object d"
      

       

      Yields:

      Command execution failed. com.bladelogic.om.infra.mfw.util.BlException: Unexpected exception while handling request: com.bladelogic.om.infra.model.generic.rest.RESTfulRequestService_processGet(java.lang.String, java.lang.String, com.bladelogic.om.infra.model.generic.rest.RESTResponseFormat), msg = Lexical error at line 1, column 47.  Encountered: "S" (83), after : "/"

       

      Attempt #2:

      blcli_execute get "/query?BQUERY=SELECT s.ip_address, d.name FROM \"SystemObject/Server s, SystemObject/Depot Object d\""
      

       

      Yields:

      <?xml version='1.0' encoding='UTF-8'?><RESTXMLResponse><ErrorResponse><Error>Resource not found. Invalid URI: Invalid bquery: FROM clause, Error in class spec, at could not find class name SystemObject/Server s, SystemObject/Depot Object d

      Could not find property s in class SystemObject

      Could not find property d in class SystemObject

       

      Attempt #3:

      blcli_execute get "/query?BQUERY=SELECT s.ip_address, d.name FROM \"SystemObject/Server\" s, \"SystemObject/Depot Object\" d"
      

       

      Yields:
      name & ip_address from SystemObject/Server (nothing from Depot Object property class)

       

      Any help would be greatly appreciated!