You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

CPS Delta feature Exceptions

Where ever possible the Delta Feature will throw the same exceptions as defined in CPS core. If any new exception for the delta feature are required the following will be updated here.

HTTP response codes for Delta API

The proposed API will be part of the CPS Data Interface. The following response codes will be returned by the API:

#Sub InterfaceMethodScenario

HTTP Response codes

to be implemented

Notes
1Data

Proposed API:

GET- /v1/dataspaces/{dataspace-name}/delta?firstAnchor={anchor-name}?secondAnchor={anchor-name}?xpath={xpath}&descendants={descendants}

Proposed method name:  <decision pending>

Generate a delta report

between 2 anchors in a

given dataspace.

  • 200 (OK)
    • success
  • 400
    • dataspace not found
      DataspaceNotFoundException
    • anchor not found
      AnchorNotFoundException
    • Data node not found
      DataNodeNotFoundException
    • invalid xpath
      CpsPathException
  • 500
    • unexpected error
AnchorNotFoundException should provide the name of missing anchor from the given two anchor names.

Request parameters:

Parameter nameInRequiredDescription
dataspace-namePathYesDataspace name
firstAnchorQueryYesFirst Anchor Name/Reference Anchor
secondAnchorQueryYesSecond Anchor Name
xpathQueryYesxpath of the node
descendantsQueryNoNumber of descendants for delta comparison. 

Response Body/Delta Report Format

Response body should contain anchors delta report (added/deleted/modified configuration) as below.
[
  {
    "action": "ADD",
    "xpath": "/bookstore/categories/[@code=3]",
    "payload": {
      "code": 3,
      "name": "kidz"
    }
  },
  {
    "action": "DELETE",
    "xpath": "/bookstore/categories/[@code=1]",
    "payload": {
      "code": 1,
      "name": "Fiction"
    }
  },
  {
    "action": "UPDATE",
    "xpath": "/bookstore/categories/[@code=2]",
    "payload": {
      "name": "Comic"
    }
  }
]

Mechanism for Delta generation

  • No labels