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
Questions/Issues | Decisions/Answers |
---|---|
Should the "descendants" option be provided as part of the API? The JSON payload may or may not contain all the child nodes. Hence there is always the uncertainty. So, would it be a better approach to fetch all descendants always? |
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:
# | Sub Interface | Method | Scenario | HTTP Response codes to be implemented | Notes |
---|---|---|---|---|---|
1 | Data | Proposed API: GET- /v2/dataspaces/{dataspace-name}/anchors/{anchor-name}/delta?xpath={xpath}&descendants={descendants} Proposed method name: getDeltaByDataspaceAnchorAndPayload() | Generate a delta report between an anchor and JSON payload |
|
Request parameters:
Parameter name | In | Required | Description |
---|---|---|---|
dataspace-name | Path | Yes | Dataspace name |
anchor1 | Query | Yes | First Anchor Name/Reference Anchor |
anchor2 | Query | Yes | Second Anchor Name |
xpath | Query | Yes | xpath of the node |
descendants | Query | No | Level of descendants for delta comparison. |