...
draw.io Diagram |
---|
border | true |
---|
| |
---|
diagramName | mapper service arch |
---|
simpleViewer | false |
---|
width | |
---|
links | auto |
---|
tbstyle | top |
---|
pageId | 93006407 |
---|
lbox | true |
---|
diagramWidth | 447 |
---|
revision | 2 |
---|
|
2. API definition guide
Swagger file: CPS-TBDMT-swagger.yaml
Template CRUD operations
Create xpath template
Interface definition | Description |
---|
Content-Type | application/json |
Operation | POST |
URI | /templates |
Request Body
Attribute | Required | Type | Description |
---|
templateId | Y | String | Identifier for the template |
model | Y | String | schema set on which xpath query should be executed |
requestType | Y | String | request type(get, post ..) |
xpathTemplate | Y | String | xpath template |
includeDescendants | Y | boolean | include descendants |
multipleQueryTemplateId | N | String | multiple query template Id |
transformParam | N | String | tranformation format("param1, param2") |
Response Codes
Code | Description |
---|
201 | Template created successfully |
400 | Bad Request (Error in request attributes) |
500 | Internal server error |
List all xpath templates
Interface definition | Description |
---|
Content-Type | application/json |
Operation | GET |
URI | /templates |
Response Codes
Code | Description |
---|
200 | Templates returned successfully |
404 | No templates found |
500 | Internal server error |
Response Body
Attribute | Required | Type | Description |
---|
templates | Y | List | List of template objects |
Template Object
Attribute | Required | Type | Description |
---|
templateId | Y | String | Identifier for the template |
model | Y | String | schema set on which xpath query should be executed |
requestType | Y | String | request type(get, post ..) |
xpathTemplate | Y | String | xpath template |
includeDescendants | Y | Boolean | include descendants |
multipleQueryTemplateId | N | String | multiple query template Id |
transformParam | N | String | transformation format("param1, param2") |
Execute template
Interface definition | Description |
---|
Content-Type | application/json |
Operation | POST |
URI | /execute/{model}/{id} |
Request Body
Attribute | Required | Type | Description |
---|
inputParameters | Y | JSON blob | Input dictionary to be applied to the template |
payload | N | JSON blob | Payload to be used during edit/patch |
Response Codes
Code | Description |
---|
200 | Template executed successfully |
400 | Bad Request (Error in request attributes) |
404 | Template Not found |
500 | Internal server error |
Response Body
Attribute | Required | Type | Description |
---|
result | Y | JSON Blob | Result of the xpath query as JSON object |
3. Definition of templates
...
- get (/anchors/{anchor}/node?xpath=)
- query (/anchors/{anchor}/nodes/query?xpath)
- query-cps-path (/anchors/{anchor}/nodes/query?cps-path)
- post (/anchors/{anchor}/nodes?xpath=)
- put (/anchors/{anchor}/nodes?xpath=)
- patch (/anchors/{anchor}/nodes?xpath=)
- post-list-node (/anchors/{anchor}/list-node?xpath=)
- delete(/anchors/{anchor}/nodes?xpath=)
- delete-list-node(/anchors/{anchor}/list-nodes/?xpath=)
7. Deployment aspects
- git clone "https://gerrit.onap.org/r/cps/cps-tbdmt"
- cd cps-tbdmt/
- mvn clean install
- cd docker-compose/
- update cps & ncmp ip-address in application.yml
- docker-compose up (use the image built using the above steps in the docker-compose file)
...