Uploaded image for project: 'Configuration Persistence Service'
  1. Configuration Persistence Service
  2. CPS-226

Spike: How to query for an element in a list by a (simple) leaf-value other then the key

XMLWordPrintable

      Given a yang list of Data Nodes

      under a know parent (path to parent is known)  TBC

      user wants to find element(s) where a leaf (attribute) has a certain value 

      e.g. 

      \ran-inventory\sliceProfilesList[{id=1, sNSSAI="a", latency=5}.
                                                        

      {id=2, sNSSAI="b", latency=6}

      ,
                                                        {id=3, sNSSAI="a", latency=6}]

      the user want to find the elment in SlicePofileList taht as an sNSSAI valueof "b"

      but he knows that the xPath 'starts with' \ran-inventory\sliceProfileList'  ([

       

      Solution Proposal

      Filter out correct data in the Persistence layer (not in higher layers, waste of data transfer etc.)

      • use query of cpsPath starting with given path (maybe even add '[')
      • use json-query tools to only get the 'fragment' that contain required name-value pair
        (probably need native-query annotation)

       PoC: Try a hardcoded db integration test.  SQL data insert would use (xpath, attributes) values like:

      /ran-inventory/sliceProfilesList[@id=1],  {"id": 1, "sNSSAI": "a", "latency": 5}

      /ran-inventory/sliceProfilesList[@id=2],  {"id": 2, "sNSSAI": "b", "latency": 6}

       

       

            niamhcore niamhcore
            ToineSiebelink Toine Siebelink
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: