Versions Compared

Key

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

...

draw.io Diagram
bordertrue
diagramNamemapper service arch
simpleViewerfalse
width
linksauto
tbstyletop
pageId93006407
lboxtrue
diagramWidth447
revision2
 
441


2. API definition guide

Swagger file: CPS-TBDMT-swagger.yaml

Template CRUD operations

Create xpath template
Interface definitionDescription
Content-Typeapplication/json
OperationPOST
URI/templates
Request Body
AttributeRequiredTypeDescription
templateIdYStringIdentifier for the template
modelYStringschema set on which xpath query should be executed
requestTypeYStringrequest type(get, post ..)
xpathTemplateYStringxpath template
includeDescendantsYbooleaninclude descendants
multipleQueryTemplateIdNStringmultiple query template Id
transformParamNStringtranformation format("param1, param2")
Response Codes
CodeDescription
201Template created successfully
400Bad Request (Error in request attributes)
500Internal server error
List all xpath templates
Interface definitionDescription
Content-Typeapplication/json
OperationGET
URI/templates
Response Codes
CodeDescription
200Templates returned successfully
404No templates found
500Internal server error
Response Body
AttributeRequiredTypeDescription
templatesYListList of template objects
Template Object
AttributeRequiredTypeDescription
templateIdYStringIdentifier for the template
modelYStringschema set on which xpath query should be executed
requestTypeYStringrequest type(get, post ..)
xpathTemplateYStringxpath template
includeDescendantsYBooleaninclude descendants
multipleQueryTemplateIdNStringmultiple query template Id
transformParamNStringtransformation format("param1, param2")
Execute template
Interface definitionDescription
Content-Typeapplication/json
OperationPOST
URI/execute/{model}/{id}
Request Body
AttributeRequiredTypeDescription
inputParametersYJSON blobInput dictionary to be applied to the template
payloadNJSON blobPayload to be used during edit/patch
Response Codes
CodeDescription
200Template executed successfully
400Bad Request (Error in request attributes)
404Template Not  found
500Internal server error
Response Body
AttributeRequiredTypeDescription
resultYJSON BlobResult of the xpath query as JSON object

3. Definition of templates

...

  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=)
  8. delete(/anchors/{anchor}/nodes?xpath=)
  9. delete-list-node(/anchors/{anchor}/list-nodes/?xpath=)


7. Deployment aspects

  1. git clone "https://gerrit.onap.org/r/cps/cps-tbdmt
  2. cd cps-tbdmt/
  3. mvn clean install
  4. cd docker-compose/
  5. update cps & ncmp ip-address in application.yml
  6. docker-compose up (use the image built using the above steps in the docker-compose file)

...