[
{
"action": "ADD",
"xpath":
Overview
The second API proposed under the Delta feature is to generate a delta between configuration stored under an Anchor and JSON payload provided by the user. All the responses and exceptions thrown by this API will be similar to the API to generate delta between 2 anchors to maintain consistency between the API's.
Issues & Decisions
...
HTTP response codes for Delta between Anchor and Payload API
The proposed API will be part of the CPS Data Interface. The following response codes will be returned by the API:
...
HTTP Response codes
to be implemented
...
Proposed API:
GET- /v2/dataspaces/{dataspace-name}/anchors/{anchor-name}/delta?xpath={xpath}&descendants={descendants}
Proposed method name: CpsDataApi.getDeltaByDataspaceAnchorAndPayload()
...
Generate a delta report between an anchor and JSON payload
...
- 200 (OK)
- success
- 400
- dataspace not found
DataspaceNotFoundException - anchor not found
AnchorNotFoundException - Data node not found
DataNodeNotFoundException - invalid xpath
CpsPathException
- dataspace not found
- 500
- unexpected error
Request parameters:
...
Response Body/Delta Report Format
...
title | Response body should contain anchors delta report (added/deleted/modified configuration) as below. |
---|---|
collapse | true |
...
"/bookstore/categories/[@code=3]",
...
"target":
...
{
"code":
...
3,
...
"name":
...
"kidz"
...
}
},
{
"action":
...
"DELETE",
...
"xpath":
...
"/bookstore/categories/[@code=1]",
...
"source":
...
{
"code":
...
1,
...
"name":
...
"Fiction"
...
}
},
{
"action":
...
"UPDATE",
...
"xpath":
...
"/bookstore/categories/[@code=2]",
"source": {
"name": "Funny"
...
},
"target": {
"name":
...
"Comic"
...
}
}
]