...
Currently after multiple data trees are stored in CPS DB. On performing the GET operation on the same data, with xpath set as root "/", the first data tree is returned by the Get Data Node API. This data tree is returned in form of a JSON Object as follows:
- CURL Request to get all data nodes under an anchor:
Code Block |
---|
curl --location 'http://localhost:8080/cps/api/v1/dataspaces/testDataspace/anchors/sample/node?xpath=%2F' \
--header 'Accept: application/json' \
--header 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE=' |
...
Code Block |
---|
title | Current JSON response body |
---|
collapse | true |
---|
|
{
"multiple-data-tree:first-container": {
"a-leaf": "a-Value"
}
} |
- CURL Request to get individual data tree(with xPath= /first-container) under an anchor:
Code Block |
---|
curl --location 'http://localhost:8080/cps/api/v1/dataspaces/testDataspace/anchors/multipleDataTree/node?xpath=%2Ffirst-container' \
--header 'Accept: application/json' \
--header 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE=' |
...
Code Block |
---|
title | Current JSON response body |
---|
collapse | true |
---|
|
{
"multiple-data-tree:first-container": {
"a-leaf": "a-Value"
}
} |
- CURL Request to get individual data tree(with xPath= /last-container) under an anchor:
Code Block |
---|
curl --location 'http://localhost:8080/cps/api/v1/dataspaces/testDataspace/anchors/sample/node?xpath=%2Flast-container' \
--header 'Accept: application/json' \
--header 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE=' |
...