Create REST endpoint: POST /dataspaces/{dataspace-name}/anchors/
JSON payload includes anchor name, module namespace and revision
How?
- Create new Rest end-point org.onap.cps.rest.controller.RestController
- Create corresponding method in CPService(impl)
- Create required entity (fragment) see https://wiki.onap.org/pages/viewpage.action?pageId=92995793
- Create corresponding method(s) in DataPersitenceService(Impl)
Acceptance/Criteria
- Dataspace has to exist, if not some HTTP Error code should be returned
- Module (namespace & revision has to exist in same dataspace), if not some HTTP Error code should be returned
- Anchor Name should be unique if not some HTTP Error code should be returned
- Anchor Name should be 'URL-safe'
- 4/5xx error if already exist. (Rishi.Chail will provide link to short-list of agreed HTTP error codes in ONAP)
- If all OK tables populated and HTTP 201 is returned
- a SQL query in separate tool will can show all anchors created for a dataspace
- Document REST endpoint clearly in our YAML file including parameters and error code meaning