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

Create list-node with one or more elements

XMLWordPrintable

      Implement the functionality to support multiple nodes addition using data fragment with list-node as a root element.

      Data JSON example:

      // references test-tree.yang (see cps-service test)
      {
        "branch": [
          { "name": "one"},
          { "name": "two"}
        ]
      }
      

      A/C

      REST layer (incl openapi update)

      • uri:
        • (CPS) POST /dataspaces/{dataspaceName}/anchor/{anchorName}/list-node
        •  (NCMP) POST /cm-handle/{cmHandle}/list-node
      • parameters:
        • xpath - parent node xpath (mandatory)
        • JSON data fragment via request body
      • response 201 on success

      Service layer

      • parse JSON string into collection of DataNode objects

      Persistence layer

      • find parent node by parent node xpath (throw not found exception if absent)
      • add all provided elements to parent node
      • persist (throw already exists exception on unique constraint violation)

            rkashapov rkashapov
            rkashapov rkashapov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: