summaryrefslogtreecommitdiffstats
path: root/docs/cps-delta-endpoints.rst
diff options
context:
space:
mode:
authorArpit Singh <as00745003@techmahindra.com>2024-01-30 10:51:28 +0530
committerArpit Singh <as00745003@techmahindra.com>2024-02-02 07:23:11 +0000
commitc45db42e7fca53873282aa8f4cff533ef1bdc0de (patch)
treef7bfe141814109a6fd8f8ef06bfaa57b0f8df6fe /docs/cps-delta-endpoints.rst
parent90b28d4b0eb228fd5906dabc50e1b543f1e3afed (diff)
Documentation update for Delta Feature
- Documantation about Delta Feature - Documantation on API 1: Delta between 2 anchors Issue-ID: CPS-2056 Signed-off-by: Arpit Singh <as00745003@techmahindra.com> Change-Id: I9841ea166f7c57ab6218fefa5b577b4053e39490
Diffstat (limited to 'docs/cps-delta-endpoints.rst')
-rw-r--r--docs/cps-delta-endpoints.rst66
1 files changed, 66 insertions, 0 deletions
diff --git a/docs/cps-delta-endpoints.rst b/docs/cps-delta-endpoints.rst
new file mode 100644
index 0000000000..b2e4e6041b
--- /dev/null
+++ b/docs/cps-delta-endpoints.rst
@@ -0,0 +1,66 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+.. Copyright (C) 2021 Pantheon.tech
+.. Copyright (C) 2024 TechMahindra Ltd.
+.. _cpsDeltaEndpoints:
+
+.. toctree::
+ :maxdepth: 1
+
+CPS Delta Endpoints
+###################
+
+The CPS Delta feature provides 1 endpoint:
+
+- /v2/dataspaces/{dataspace-name}/anchors/{anchor-name}/delta
+
+Description
+-----------
+The following is a Get endpoint, which allows the user to find the delta between configurations stored under two anchors within the same dataspace.
+
+Path Parameters
+---------------
+The endpoint takes 2 path parameters as input:
+ - **dataspace-name:** name of dataspace where the 2 anchors to be used for delta generation are stored.
+ - **anchor-name:** the source anchor name, the data under this anchor will be the reference data for delta report generation
+
+Query Parameters
+----------------
+The endpoint takes 3 query parameters as input:
+ - **target-anchor-name:** the data retrieved from target anchor gets compared against the data retrieved from source anchor
+ - **xpath:** the xpath to a particular data node, Example: /bookstore/categories[@code='1']
+ - **descendants:** specifies the number of descendants to query.
+
+Sample Delta Report
+-------------------
+
+.. code-block:: json
+
+ [
+ {
+ "action": "ADD",
+ "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": "UPDATE",
+ "xpath": "/bookstore/categories/[@code=2]",
+ "source-data": {
+ "name": "Funny"
+ },
+ "target-data": {
+ "name": "Comic"
+ }
+ }
+ ] \ No newline at end of file