/
Using delta reports to perform bulk update operations

Using delta reports to perform bulk update operations

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/api/v2/dataspaces/{dataspace-name}/apply-delta

Request parameters:

Parameter name

In

Description

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/api/v2/dataspaces/{dataspace-name}/anchors/{anchor-name}/apply-delta

Request parameters:

Parameter name

In

Description

Parameter name

In

Description

dataspace-name

path

dataspace name

anchor-name

path

anchor name where delta will be applied

[ { "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" } } ]

 

Related content

Analysis of Get a Node API
Analysis of Get a Node API
Read with this
Delta Report for Bulk Operations
Delta Report for Bulk Operations
More like this
Inconsistencies with CPS Core API's
Inconsistencies with CPS Core API's
Read with this
CPS-2310: Refactoring of CPS Delta APIs
CPS-2310: Refactoring of CPS Delta APIs
More like this
Grouping of generated delta reports in Delta Feature
Grouping of generated delta reports in Delta Feature
More like this
Grouping of Update operation in Delta Report
Grouping of Update operation in Delta Report
More like this