Versions Compared

Key

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

...

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:

Expand
titleRequest body
Code Block
[
  {
    "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"
    }
  }
]