Versions Compared

Key

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

...

#Existing EndpointUpdated EndpointPath/Query ParametersResponse Codes
1

GET-/v2/dataspaces/{dataspace-name}/anchors/{anchor-name}/deltaAnchors

GET-/v2/dataspaces/{dataspace-name}/anchors/{source-anchor-name}/delta


Parameter NameInRequiredDescription
dataspace-namePathYesDataspace name
source-anchor-namePathYesFirst Anchor Name/Reference Anchor
target-anchor-nameQueryYesSecond Anchor Name/Comparand Anchor
descendantsQueryNoLevel of descendants for delta comparison. 
xpathQueryYesxpath of the node


  • 200 (OK)
    • success
  • 400
    • dataspace not found
      DataspaceNotFoundException
    • anchor not found
      AnchorNotFoundException
    • Data node not found
      DataNodeNotFoundException
    • invalid xpath
      CpsPathException
  • 500
    • unexpected error
2

POST- /v2/dataspaces/{dataspace-name}/anchors/{anchor-name}/deltaPayload

POST- /v2/dataspaces/{dataspace-name}/anchors/{source-anchor-name}/delta


Parameter NameInRequiredDescription
dataspace-namePathYesDataspace name
source-anchor-namePathYesFirst Anchor Name/Reference Anchor
xpathQueryYesxpath of the node
FileBody (multipart/form-data TBC)OptionalYang file/Zip file containing the schema details.
Text/StringBody (multipart/form-data)YesJSON payload as plain text


Changes and Justification for going

...

with second approach

The second proposed approach is best suited for the scenario, but there are a few minor changes to it:

...

  • we have two different ways to generate delta, so we can say the final operation is common that is "delta". So, the idea is to have the common components between the operations as path parameters, i.e dataspace name and first anchor name
  • remaining components should be in query, that is target anchor name, and fetch descendants' option in first operation and JSON payload and schema in second operation.
  • this approach is also consistent with existing CPS API's such as list-node APIs where a singular endpoint performs different operations while having similar parameters