Skip to end of metadata
Go to start of metadata

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

Compare with Current View Version History

« Previous Version 3 Next »

Objective

Delta report provides the list of actions (ADD/DELETE/UPDATE) and changed data. This delta report can be used to perform bulk updates on a given anchor.

Implementation

To perform bulk update operation using delta report we will implement a new REST API as given below

URL : PUT http://localhost:8080/cps/v2/dataspaces/{dataspace-name}/

Request parameters:

Parameter name

In

Description

dataspace-name

path

dataspace name

source-delta-anchor

query

source delta anchor

target-delta-anchor

query

target delta anchor

target-anchor

query

anchor name where delta will be applied

Alternatively, we can also use below REST API:

URL : PUT http://localhost:8080/cps/v2/dataspaces/{dataspace-name}/anchors/{anchor-name}

Request parameters:

Parameter name

In

Description

dataspace-name

path

dataspace name

anchor-name

path

anchor name where delta will be applied

 Request body
[
  {
    "action": "create",
    "xpath": "/bookstore/categories/[@code=3]",
    "target-data": {
      "code": "3,",
      "name": "kidz"
    }
  },
  {
    "action": "remove",
    "xpath": "/bookstore/categories/[@code=1]",
    "source-data": {
      "code": "1,",
      "name": "Fiction"
    }
  },
  {
    "action": "replace",
    "xpath": "/bookstore/categories/[@code=2]",
    "source-data": {
      "name": "Funny"
    },
    "target-data": {
      "name": "Comic"
    }
  }
]

  • No labels