Versions Compared

Key

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

...

6. Multiple query Example

Example test-tree model:

{"branch":[{"name":"Right","nest":{"name":"Big","birds":["Owl","Raven","Crow"]}},{"name":"Left","nest":{"name":"Small","birds":["Robin","Sparrow","Finch"]}}]}

Get-all-data
curl --location --request POST 'http://localhost:8080/templates' --header 'Content-Type: application/json' --data-raw '{
"templateId": "get-all-data",
"model": "CSIT-SchemaSet",
"requestType": "get",
"xpathTemplate": "/test-tree",
"includeDescendants": true,
"transformParam":"branch,name"
}' -i

curl --location --request POST 'http://localhost:8080/execute/CSIT-SchemaSet/get-all-data' --header 'Content-Type: application/json' --data-raw '{
"inputParameters": {
}
}' -i

...

The above response will be inserted ({{name}}) in the below template and will be executed twice(First "/test-tree/branch[@name='Left']/nest"  and then "/test-tree/branch[@name='Right']/nest") to give collective output.

Get-branch
curl --location --request POST 'http://localhost:8080/templates' --header 'Content-Type: application/json' --data-raw '{
"templateId": "get-branch",
"model": "CSIT-SchemaSet",
"requestType": "get",
"xpathTemplate": "/test-tree/branch[@name='\''{{name}}'\'']/nest",
"includeDescendants": true,
"multipleQueryTemplateId":"get-all-data",
"transformParam":"birds"
}' -i

Responses
//get-all-data
["Left","Right"]
//get-branch
[["Owl","Raven","Crow"]], [["Robin","Sparrow","Finch"]]

6. Supported requestTypes:

  1. get (/anchors/{anchor}/node?xpath=)
  2. query (/anchors/{anchor}/nodes/query?xpath)
  3. query-cps-path (/anchors/{anchor}/nodes/query?cps-path)
  4. post (/anchors/{anchor}/nodes?xpath=)
  5. put (/anchors/{anchor}/nodes?xpath=)
  6. patch (/anchors/{anchor}/nodes?xpath=)
  7. post-list-node (/anchors/{anchor}/list-node?xpath=)


7. Deployment aspects1.

  1. git clone "https://gerrit.onap.org/r/cps/cps-tbdmt

...

  1. cd cps-tbdmt/

...

  1. mvn clean install

...

  1. cd docker-compose/

...

  1. update cps & ncmp ip-address in application.yml

...

  1. docker-compose up (use the image built using the above steps in the docker-compose file)