HMC

 View Only
Expand all | Collapse all

Need help with rest endpoint doing search (what format is the query value supposed to be)

  • 1.  Need help with rest endpoint doing search (what format is the query value supposed to be)

    Posted Mon June 17, 2024 01:15 PM

    • https://www.ibm.com/docs/en/power9?topic=interfaces-hmc-rest-apis
    • /rest/api/uom/{R}/search/{QUERY} ----> get the feed of instances of {R} matching the query

    for the QUERY value I have tried

    • (PartitionName=abc) and various other versions of this including double and single quotes, but get
      • 500 Internal Server Error : <ReasonCode kb="ROR" kxe="false">Unknown internal error.</ReasonCode>
                    <Message kxe="false" kb="ROO">Unable to parse the remainder of the following expression: =abc</Message>


    ------------------------------
    Warren Goldman
    ------------------------------


  • 2.  RE: Need help with rest endpoint doing search (what format is the query value supposed to be)

    Posted Tue June 18, 2024 09:12 AM

    Off the top of my head I'd say you probably need to url encode  the equal sign = as %3D so the web server doesn't mangle it.



    ------------------------------
    Vincent Greene
    IT Consultant
    Technology Expert labs
    IBM
    Vincent.Greene@ibm.com


    The postings on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
    ------------------------------



  • 3.  RE: Need help with rest endpoint doing search (what format is the query value supposed to be)

    Posted Thu June 20, 2024 09:42 AM

    The format for search query value is as follows (for example:  PartitionName==ABC)

      /rest/api/uom/{R}/search/(PartitionName=='ABC')

     and it is always better to pass value with single quote in some of the cases value can have space as below 

      /rest/api/uom/{R}/search/(PartitionState=='not activated')

    and instead of search API you can use quick API because quick API's are much faster.



    ------------------------------
    REKHA BOMKANTI
    ------------------------------