Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

#Sub interfaceMethodScenarioSpecified HTTP Response CodeImplemented HTTP Response CodeComments
1Admin

POST - /v1/dataspaces

CpsAdminApi.createDataspace()

Create a new dataspace

201

400

401

403

201 (created)

  • for success

409 (conflict)

  • for data integrity violation when persisting (AlreadyDefinedException)

500 (internal server error)DataNodeNotFoundException

  • for unexpected system errors

Specification:

  • Remove 400, add
  • Add 409
2Admin

DELETE - /v1/dataspaces

CpsAdminApi.deleteDataspace()

Delete a dataspace

204

400

401

403

409

204 (no content)

  • for success

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)

3Admin

GET - /v1/dataspaces/{dataspace-name}/anchors

CpsAdminApi.getAnchors()

Read all anchors, given a dataspace

200

400

401

403

404

200 (ok)

  • for success

400 (bad request)

  • for dataspace not found (DataspaceNotFoundException)

500 (internal server error)

  • for unexpected system errors

Specification:

  • Keep only one of 400 or 404 when dataspace is not found.
4Admin

POST - /v1/dataspaces/{dataspace-name}/anchors

CpsAdminApi.createAnchor()

Create a new anchor in the given dataspace

201

400

401

403

201 (created)

  • for success

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:

  • Add 409
5Admin

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)

  • for success

400 (bad request)

  • for dataspace not found (DataspaceNotFoundException)
  • for anchor not found (AnchorNotFoundException)

500 (internal server error)

  • for unexpected system errors

Specification:

  • Remove 404
6Admin

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)

  • for success

400 (bad request)

  • for dataspace not found (DataspaceNotFoundException)
  • for anchor not found (AnchorNotFoundException)

500 (internal server error)

  • for unexpected system errors
(tick)
7Admin

POST - /v1/dataspaces/{dataspace-name}/schema-sets

CpsAdminApi.createSchemaSet()

Create a new schema set in the given dataspace

201

400

401

403

201 (created)

  • for success

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:

  • Add 409

Implementation

  • Concurrency error is 500, but there is not much that can be done on the server side, the client would have to resend ...
8Admin

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)

  • for success

400 (bad request)

  • for dataspace not found (DataspaceNotFoundException)
  • for schema set not found (SchemaSetNotFoundException)

500 (internal server error)

  • for unexpected system errors

Specification:

  • Remove 404
9Admin

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)

  • for success

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)
10Data

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)

  • for success

400 (bad request)

  • for dataspace not found (DataspaceNotFoundException)
  • for anchor not found (AnchorNotFoundException)

500 (internal server error)

  • for unexpected system errors

Specification:

  • Remove 404
11Data

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)

  • for success

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 ...
12Data

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)

  • for success

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

Implementation:

  • Wondering about data node not found here ...
13Data

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)

  • for success

400 (bad request)

  • for data node not found (DataNodeNotFoundException)

500 (internal server error)

  • for unexpected system errors
(tick)
14Data

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)

  • for success

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)
15Data

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)

  • for success

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)
16Data

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)

  • for success

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)
17Data

DELETE - /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-nodes

CpsDataApi.deleteListOrListElement()

Delete one or all list element(s) for a given

17Data

DELETE - /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-nodes

CpsDataApi.deleteListOrListElement()

Deprecated

Delete one or all list element(s) for a given anchor and dataspace

204

400

401

403

401

403

204 (no content)

  • for success

400 (bad request)

  • for targetprobably not a list (DataNodeNotFoundException)

500 (internal server error)

  • for unexpected system errors
Deprecated, ignored
18Query

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)

  • for success

400 (bad request)

  • for dataspace not found (DataspaceNotFoundException)
  • for anchor not found (AnchorNotFoundException)
  • for failure when parsing provided cps path (CpsPathException)
Query data nodes for the given dataspace and anchor using CPS path
  • 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

200

400

401

403

404


CPS-NCMP

#Sub interfaceMethodScenarioSpecified HTTP Response CodeImplemented HTTP Response CodeCommentsBody
1Data

HTTP: GET - /v1/ch/{cm-handle}/data/ds/ncmp-datastore:passthrough-operational

NetworkCmProxyApi.getResourceDataOperationalForCmHandle()

Get resource data from pass-through operational for given cm handle

200

400

401

403

404

200

500



2Data

GET - /v1/ch/{cm-handle}/data/ds/ncmp-datastore:passthrough-running

NetworkCmProxyApi.getResourceDataRunningForCmHandle()

Get resource data from pass-through running for given cm handle

200

400

401

403

404

200

500



3Data

PUT- /v1/ch/{cm-handle}/data/ds/ncmp-datastore:passthrough-running

NetworkCmProxyApi.updateResourceDataRunningForCmHandle()

Update resource data from pass-through running for the given cm handle

200

400

401

403

404

200

500



4Data

POST - /v1/ch/{cm-handle}/data/ds/ncmp-datastore:passthrough-running

NetworkCmProxyApi.createResourceDataRunningForCmHandle()

Create resource data from pass-through running for given cm handle

201

400

401

403

404

201

500



5Data

PATCH - /v1/ch/{cm-handle}/data/ds/ncmp-datastore:passthrough-running

NetworkCmProxyApi.patchResourceDataRunningForCmHandle()

Patch resource data from pass-through running for the given cm handle

200

400

401

403

404

200

500



6Model

GET - /v1/ch/{cm-handle}/modules

NetworkCmProxyApi.getModuleReferencesByCmHandle

Fetch all module references (name and revision) for a given cm handle

200

400

401

403

404

200

500



7Model

POST - /v1/ch/searches

NetworkCmProxyApi.executeCmHandleSearch

Execute cm handle searches using 'hasAllModules' condition to get all cm handles for the given module names

200

400

401

403

200

500



8Inventory

POST /v1/ch

NetworkCmProxyInventoryApi.updateDmiPluginRegistration()

Register, update or remove cm handles

201

400

401

403

403

201

500

Specification:

  • Should success always be 200 (general ok) instead of 201 (created) that might look confusing for updates and removals ?

201

500

Implementation:

  • Invalid requests should return 4xx with an explanation message instead of 500 without information (ex: Invalid combination of plugin service names, URI is not absolute, ...)

...

#Sub interfaceMethodScenarioSpecified HTTP Response CodeImplemented HTTP Response CodeComments
1Query

GET - /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/history

CpsTemporalQueryApi.getAnchorDataByName()

Get anchor data by name

200

400

401

403

200 (ok)

  • for success

400 (bad request)

  • for input data validation errors

500 (internal server error)

  • for unexpected system errors

(tick)

2Query

GET - /v1/dataspaces/{dataspace-name}/anchors/history

CpsTemporalQueryApi.getAnchorsDataByFilter()


Get anchors data based on filter criteria

200

400

401

403

200 (ok)

  • for success

400 (bad request)

  • for input data validation errors

500 (internal server error)

  • for unexpected system errors

(tick)

General comments for all endpoints

Specification

  • Always ensure that client request related errors return 4xx along with a clear explanation provided to the client about the reason for the error. When 4xx errors occur, the system itself is behaving as expected.
  • 500 response codes should only correspond to unexpected errors that require support investigation and effort in order to be fixed (ex: network communication issue, dependent component or system down, corrupted data, application bug, ...). For 500 errors no details are really expected in the response for the client, all the information to investigate the problem should be available in the logs.
  • Review 401 and 403 responses code from specification that are not implemented yet.
  • 500 needs to be added to the specification for all endpoints

Implementation

  • Is NotFoundInDataspaceException used ? If not, could it be removed ?
  • Handling of DataNodeNotFoundException in CpsRestExceptionHandler supports a different return code (404) when http method is get. Is this implementation used ? If not, could it be removed ?