Table of Contents
ONAP Guidelines
...
# | Use case | Scenario | DB (Spring) Response | SPI Response | Java API | REST API Response Code | Response Body | Error Object Message |
---|---|---|---|---|---|---|---|---|
1 | Add dataspace | dataspace already exists | DataIntegrityViolationException | DataspaceAlreadyDefinedException | DataspaceAlreadyDefinedException | 400 (bad request) | json error object | dataspace xyz already defined |
2 | Add schema set to dataspace | schema set with same name already exists | DataIntegrityViolationException | SchemaSetAlreadyDefinedException | SchemaSetAlreadyDefinedException | 400 (bad request) | json error object | schema set xyz already defined for dataspace abc |
3 | Add schema set to dataspace | dataspacename does not exist | No records (Optional, not present) | DataspaceNotFoundException | DataspaceNotFoundException | 400 (bad request) | json error object | TBD |
4 | Add schema set to dataspace | the schema set throws a validation exception when parsed with ODL Yang Parser e.g.
| N/A | N/A | ModelValidationException (e casue) details should contain cause message | 400 (bad request) | json error object | message and details from the original exception. |
5 | List anchors for dataspace name | dataspacename does not exist | No records (Optional, not present) | DataspaceNotFoundException | DataspaceNotFoundException | 400 (bad request) | json error object | dataspace xyz not found |
6 | List anchors for dataspace name | no anchor records in DB | 0 records | empty collection | empty collection | 200 (ok) | empty list | N/A |
7 | Add a fragment | Insert a fragment that violates the unique constraint e.g. when trying to insert a fragment with the same property values(dataspace_id,anchor_id,xpath) as an existing fragment. | DataIntegrityViolationException | |||||
8 | Remove schema set | Schema set removal is requested from REST (or via API/SPI with explicitly defined option prohibiting removal of associated anchors and data if found) and there is (are) associated anchor record(s) in database. | N/A | SchemaSetInUseException | SchemaSetInUseException | 409 (Conflict) | json error object | schama set abc in dataspace xyz is having anchor records associated. |
9 | Get a fragment that does not exist | get fragment by xpath that does not exist | FragmentNotFoundException | DataNodeNotFoundException | DataNodeNotFoundException | 400 (bad request) | json error object | datanode with xpath xyz not found in dataspace xyz |
10 | Invalid cps path | a cpsPath that cannot be parsed i.e. not recognized as a valid query
| CpsPathException | CpsPathException | CpsPathException | 400 (bad request) | json error object | message and details from the original exception. |
11 | Data node already exists | Create the same data node twice | DataIntegrityViolationException | DataNodeAlreadyDefined | DataNodeAlreadyDefined | 409 (Conflict) | json error object | Data node already defined for dataspace abc |
12 | Unsupported update node leaves | Unsupported json data when
private DataNode buildFromNormalizedNodeTree() { |
| DataValidationException | DataValidationException | 400 | json error object | "Unsupported json data: " + jsonData |
13 | Delete dataspace with anchor/s | Delete dataspace that still contains 1 or more anchor | DataspaceInUseException | DataspaceInUseException | 409 (Conflict) | json error object | dataspace contains anchor(s) | |
14 | Delete dataspace with schemaset/s | Delete dataspace that still contains 1 or more schemaset | DataspaceInUseException | DataspaceInUseException | 409 (Conflict) | json error object | dataspace contains schemaset(s) |
...
# | Sub interface | Method | Scenario | Specified HTTP Response Code | Implemented HTTP Response Code | Changes required |
---|---|---|---|---|---|---|
1 | Admin | POST - /v1/dataspaces CpsAdminApi.createDataspace() | Create a new dataspace | 201 400 401 403 | 201 (created)
409 (conflict)
500 (internal server error)
| Specification:
|
2 | Admin | DELETE - /v1/dataspaces CpsAdminApi.deleteDataspace() | Delete a dataspace | 204 400 401 403 409 | 204 (no content)
400 (bad request)
409 (conflict)
500 (internal server error)
| |
3 | Admin | GET - /v1/dataspaces/{dataspace-name}/anchors CpsAdminApi.getAnchors() | Read all anchors, given a dataspace | 200 400 401 403 404 | 200 (ok)
400 (bad request)
500 (internal server error)
| Specification:
|
4 | Admin | POST - /v1/dataspaces/{dataspace-name}/anchors CpsAdminApi.createAnchor() | Create a new anchor in the given dataspace | 201 400 401 403 | 201 (created)
400 (bad request)
409 (conflict)
500 (internal server error)
| Specification:
|
5 | Admin | GET - /v1/dataspaces/{dataspace-name}/anchors/{anchor-name} CpsAdminApi.getAnchor() | Read an anchor given an anchor name and a dataspace | 200 400 401 403 404 | 200 (ok)
400 (bad request)
500 (internal server error)
| Specification:
|
6 | Admin | DELETE - /v1/dataspaces/{dataspace-name}/anchors/{anchor-name} CpsAdminApi.deleteAnchor() | Delete an anchor given an anchor name and a dataspace | 204 400 401 403 | 204 (no content)
400 (bad request)
500 (internal server error)
| |
7 | Admin | POST - /v1/dataspaces/{dataspace-name}/schema-sets CpsAdminApi.createSchemaSet() | Create a new schema set in the given dataspace | 201 400 401 403 | 201 (created)
400 (bad request)
409 (conflict)
500 (internal server error)
| Specification:
Implementation
|
8 | Admin | GET - /v1/dataspaces/{dataspace-name}/schema-sets/{schema-set-name} CpsAdminApi.getSchemaSet() | Read a schema set given a schema set name and a dataspace | 200 400 401 403 404 | 200 (ok)
400 (bad request)
500 (internal server error)
| Specification:
|
9 | Admin | DELETE - /v1/dataspaces/{dataspace-name}/schema-sets/{schema-set-name} CpsAdminApi.deleteSchemaSet() | Delete a schema set given a schema set name and a dataspace | 204 400 401 403 409 | 204 (no content)
400 (bad request)
409 (conflict)
500 (internal server error)
| |
10 | Data | GET - /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/node CpsDataApi.getNodeByDataspaceAndAnchor() | Get a node with an option to retrieve all the children for a given anchor and dataspace | 200 400 401 403 404 | 200 (ok)
400 (bad request)
500 (internal server error)
| Specification:
|
11 | Data | PUT - /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes CpsDataApi.replaceNode() | Replace a node with descendants for a given dataspace, anchor and a parent node xpath | 200 400 401 403 | 200 (ok)
400 (bad request)
500 (internal server error)
| Implementation:
|
12 | Data | POST - /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes CpsDataApi.createNode() | Create a node for a given anchor and dataspace | 201 400 401 403 | 201 (created)
400 (bad request)
409 (conflict)
500 (internal server error)
| Specification:
|
13 | Data | DELETE - /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes CpsDataApi.deleteDataNode() | Delete a datanode for a given dataspace and anchor given a node xpath. | 204 400 401 403 | 204 (no content)
400 (bad request)
500 (internal server error)
| |
14 | Data | PATCH - /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes CpsDataApi.updateNodeLeaves() | Update a data node leaves for a given dataspace and anchor and a parent node xpath | 200 400 401 403 | 200 (ok)
400 (bad request)
500 (internal server error)
| |
15 | Data | PUT - /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-nodes CpsDataApi.replaceListContent() | Replace list content under a given parent, anchor and dataspace | 200 400 401 403 | 200 (ok)
400 (bad request)
500 (internal server error)
| |
16 | Data | POST - /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-nodes CpsDataApi.addListElements() | Add list element(s) to a list for a given anchor and dataspace | 201 400 401 403 | 201 (created)
400 (bad request)
500 (internal server error)
| |
17 |
|
|
|
| ||
18 | Query | GET - /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes/query CpsQueryApi.getNodesByDataspaceAndAnchorAndCpsPath() | Query data nodes for the given dataspace and anchor using CPS path | 200 400 401 403 404 | 200 (ok)
400 (bad request)
500 (internal server error)
| Implementation: Failure to parse fragment entity should not be a client error ?
|
CPS-NCMP
(commit id 8c9b4a24b4841154a2d08f506e2f7beca4f6fc31)
...