# | 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) - for data integrity violation when persisting (AlreadyDefinedException)
500 (internal server error) - for unexpected system errors
| Specification: |
2 | Admin | DELETE - /v1/dataspaces CpsAdminApi.deleteDataspace() | Delete a dataspace | 204 400 401 403 409 | 204 (no content) 400 (bad request) - for dataspace not found (DataspaceNotFoundException)
409 (conflict) - for dataspace having anchors or schema sets (DataspaceInUseException)
500 (internal server error) - for unexpected system errors
| ![(tick)](/s/z10khv/8804/xgjkrn/_/images/icons/emoticons/check.svg)
|
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) - for dataspace not found (DataspaceNotFoundException)
500 (internal server error) - for unexpected system errors
| 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) - for dataspace not found (DataspaceNotFoundException)
- for schema set not found (SchemaSetNotFoundException)
409 (conflict) - for data integrity violation when persisting (AlreadyDefinedException)
500 (internal server error) - for unexpected system errors
| 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) - for dataspace not found (DataspaceNotFoundException)
- for anchor not found (AnchorNotFoundException)
500 (internal server error) - for unexpected system errors
| 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) - for dataspace not found (DataspaceNotFoundException)
- for anchor not found (AnchorNotFoundException)
500 (internal server error) - for unexpected system errors
| ![(tick)](/s/z10khv/8804/xgjkrn/_/images/icons/emoticons/check.svg) |
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) - for different errors related to input schema set file reading (CpsException)
- for zip schema set file size exceeding defined limit (ModelValidationException)
- for zip schema set file number entries exceeding defined limit (ModelValidationException)
- for zip schema set file containing no yang files (ModelValidationException)
- for multiple resources with same name contained in zip schema set file (ModelValidationException)
- for schema set file name extension different from yang or zip (ModelValidationException)
- for invalid Yang syntax (ModelValidationException)
- for dataspace not found (DataspaceNotFoundException)
409 (conflict) - for data integrity violation when persisting (AlreadyDefinedException)
500 (internal server error) - for concurrency error when several clients are requesting to create the exact same resource at the same time and that the automatic retry keeps failing (DuplicatedYangResourceException)
- for unexpected system errors
| Specification: Implementation - Concurrency error is 500, but there is not much that can be done on the server side, the client would have to resend ... Should it be 400 instead ? => Decision made to keep 500
|
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) - for dataspace not found (DataspaceNotFoundException)
- for schema set not found (SchemaSetNotFoundException)
500 (internal server error) - for unexpected system errors
| 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) - for dataspace not found (DataspaceNotFoundException)
- for schema set not found (SchemaSetNotFoundException)
409 (conflict) - for existence of anchors using the schema set (SchemaSetInUseException)
500 (internal server error) - for unexpected system errors
| ![(tick)](/s/z10khv/8804/xgjkrn/_/images/icons/emoticons/check.svg) |
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) - for dataspace not found (DataspaceNotFoundException)
- for anchor not found (AnchorNotFoundException)
500 (internal server error) - for unexpected system errors
| 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) - for error while parsing json data or not supported xpath (DataValidationException)
- for dataspace not found (DataspaceNotFoundException)
- for anchor not found (AnchorNotFoundException)
- for data node not found (DataNodeNotFoundException)
500 (internal server error) - for concurrent transactions making data to be updated stale (ConcurrencyException)
- for unexpected system errors
| Implementation: - Concurrency error is 500, but there is not much that can be done on the server side, the client would have to resend ... Should it be 400 instead ? => Decision made to keep 500
|
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) - for error while parsing json data or not supported xpath (DataValidationException)
- for dataspace not found (DataspaceNotFoundException)
- for anchor not found (AnchorNotFoundException)
- for data node not found (DataNodeNotFoundException)
409 (conflict) - for data integrity violation when persisting (AlreadyDefinedException)
500 (internal server error) - for unexpected system errors
| 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) - for data node not found (DataNodeNotFoundException)
500 (internal server error) - for unexpected system errors
| ![(tick)](/s/z10khv/8804/xgjkrn/_/images/icons/emoticons/check.svg) |
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) - for error while parsing json data or not supported xpath (DataValidationException)
- for dataspace not found (DataspaceNotFoundException)
- for anchor not found (AnchorNotFoundException)
- for data node not found (DataNodeNotFoundException)
500 (internal server error) - for unexpected system errors
| ![(tick)](/s/z10khv/8804/xgjkrn/_/images/icons/emoticons/check.svg) |
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) - for error while parsing json data or not supported xpath (DataValidationException)
- for no data nodes provided (DataValidationException)
- for dataspace not found (DataspaceNotFoundException)
- for anchor not found (AnchorNotFoundException)
- for data node not found (DataNodeNotFoundException)
500 (internal server error) - for unexpected system errors
| ![(tick)](/s/z10khv/8804/xgjkrn/_/images/icons/emoticons/check.svg) |
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) - for error while parsing json data or not supported xpath (DataValidationException)
- for no data nodes provided (DataValidationException)
- for dataspace not found (DataspaceNotFoundException)
- for anchor not found (AnchorNotFoundException)
- for data node not found (DataNodeNotFoundException)
500 (internal server error) - for unexpected system errors
| ![(tick)](/s/z10khv/8804/xgjkrn/_/images/icons/emoticons/check.svg) |
17 | Data | DELETE - /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-nodes
CpsDataApi.deleteListOrListElement()
| Delete one or all list element(s) for a given anchor and dataspace
| 204
400
401
403
| 204 (no content)
400 (bad request)
for targetprobably not a list (DataNodeNotFoundException)
500 (internal server error)
for unexpected system errors
| Deprecated, ignored |
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) - for dataspace not found (DataspaceNotFoundException)
- for anchor not found (AnchorNotFoundException)
- for failure when parsing provided cps path (CpsPathException)
- for failure when parsing retrieved fragment entity attributes (DataValidationException)
500 (internal server error) - for unexpected system errors
| Implementation: - Failure to parse fragment entity should not be a client error ?
- 404 not needed
|