-
Story
-
Resolution: Done
-
Highest
-
None
-
None
-pre conditions
dataspace created, anchor creates, schema set uploaded and associated with anchor
Steps/flow
- Upload some json data for an anchor
- Retrieve the anchor to get the schemasSet name
- System should retrieve the schema set resources/schemaContext for that anchor (
CPS-135) (using cache) - Parse & validate the uploaded yang into a data node object (tree)
- Persist the data node using the code developed as part of
CPS-136
Scope of this user story:
- Tie together what has been delivered in
CPS-135/136/137:- Add relevant Java API method to store JSON Data Object
- add relevant REST API method to store JSON Data Object
- Add and handle error handling (especially HTTP code)
Use existing code to convert a json file with just data for 1 container and 1 child into Fragments PoJo and then store the Fragments
Might need to create a new simpler sample store instance (in test resources) from https://gerrit.onap.org/r/gitweb?p=cps.git;a=blob;f=cps-service/src/test/resources/bookstore.json;h=d1b8d6882dd96b57251d8dee35f2e565881415d2;hb=refs/heads/master
Retrieve the Schema Set from Anchor to create a schemacontext , similar to what is done here: https://gerrit.onap.org/r/c/cps/+/116280/8/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsModulePersistenceServiceImpl.java
Validate data is confirm that Module (using existing validation built-in ODL Yang parser)
Creating fragment is done already here : org.onap.cps.utils.YangUtils#fragmentNormalizedNode(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<? extends org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument,?>, org.opendaylight.yangtools.yang.model.api.Module)
If data not confirm model i.e ODL Parser thrown an exception it should be rejected (see exception handling agreed here: https://wiki.onap.org/display/DW/CPS+Exceptions+and+REST+API+HTTP+Response+Codes)
Acceptance Criteria
- Create a Wiki Page with Proposal and get team agreement
- include exceptions and error codes documented on https://wiki.onap.org/display/DW/CPS+Exceptions+and+REST+API+HTTP+Response+Codes
- Can add a valid json data file to an existing anchor
- parent and child (or children) will be persisted
- The Anchor fragment (created earlier) should become the parent for the Data fragment
- JSON File will be rejected if not confirm the model
- All relevant testing should be included
- MVC 'semi-integration' test
- DB Level tests should be included (in
CPS-136) - Unit test where needed to fill coverage
- blocks
-
CPS-170 Test E2E Network Slicing data instance with CPS
- Closed
- duplicates
-
CPS-76 VSE: Add container with children to given anchor
- Closed
- is blocked by
-
CPS-137 Replace Fragment Class with DataNode class as per agreed Java API
- Closed
-
CPS-21 VSE: List all Module references in a given Dataspace and Schema Set Name
- Closed
-
CPS-32 DM: [Spike] Break down json data object into fragments that can be stored in generic schema
- Closed
-
CPS-135 Retrieve the SchemaSet resources for an Anchor
- Closed
-
CPS-136 Persisting data nodes (fragments tree structure)
- Closed
-
CPS-42 VSE: Create an anchor in the given dataspace
- Delivered