Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

1. Overview

This service shall be used to map the erstwhile Config-DB-like REST APIs to appropriate CPS API calls. The purpose of this service is to abstract the details of (possibly multiple, and complex) XPath queries from the users of CPS. It enables CPS-users to continue using simple REST API calls that are intuitive and easy-to-understand and implement. The mapping to appropriate queries to CPS (including mapping of one API call to many Xpath queries) shall be done in a generic way by the API Mapper service.


2. Architecture

 

3. API definition guide

Template CRUD operations

Create xpath template

Interface definitionDescription
Content-Typeapplication/json
OperationPOST
URI/api/v1/templates

Request Body

AttributeRequiredTypeDescription
idYStringIdentifier for the template
schema-setYStringschema set on which xpath query should be executed
templateYStringxpath template

Response Codes

CodeDescription
201Template created successfully
400Bad Request (Error in request attributes)
500Internal server error

List all xpath template

Interface definitionDescription
Content-Typeapplication/json
OperationGET
URI/api/v1/templates

Response Codes

CodeDescription
200Templates returned successfully
404No templates found
500Internal server error

Response Body

AttributeRequiredTypeDescription
templatesYListList of template objects

Template Object

AttributeRequiredTypeDescription
idYStringIdentifier for the template
schema-setYStringschema set on which xpath query should be executed
templateYStringxpath template

Get a xpath template by id

Interface definitionDescription
Content-Typeapplication/json
OperationGET
URI/api/v1/templates/{schema-set}/{id}

Response Codes

CodeDescription
200Template found and returned
404Template not found
500Internal server error

Response Body

Same as template Object

Delete xpath template

Interface definitionDescription
Content-Typeapplication/json
OperationDELETE
URI/api/v1/templates/{schema-set}/{id}

Response Codes

CodeDescription
200Template deleted successfully
400Bad Request (Error in request attributes)
500Internal server error

Execute template

Interface definitionDescription
Content-Typeapplication/json
OperationPOST
URI/api/v1/execute/{schema-set}/{id}

Request Body

AttributeRequiredTypeDescription
InputYJSON blobInput dictionary to be applied to the template

Response Codes

CodeDescription
200Template executed successfully
400Bad Request (Error in request attributes)
500Internal server error

Response Body

AttributeRequiredTypeDescription
resultYJSON BlobResult of the xpath query as JSON object

4. Dependencies

  • Definition of templates


5. Deployment aspects

To be updated


  • No labels