You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 11
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
Swagger file: api-mapper-service-swagger.yaml
Template CRUD operations
Create xpath template
Interface definition | Description |
---|
Content-Type | application/json |
Operation | PUT |
URI | /api/v1/templates |
Request Body
Attribute | Required | Type | Description |
---|
id | Y | String | Identifier for the template |
model | Y | String | schema set on which xpath query should be executed |
xpathTemplate | Y | String | xpath template |
Response Codes
Code | Description |
---|
201 | Template created successfully |
400 | Bad Request (Error in request attributes) |
500 | Internal server error |
List all xpath template
Interface definition | Description |
---|
Content-Type | application/json |
Operation | GET |
URI | /api/v1/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 |
---|
id | Y | String | Identifier for the template |
model | Y | String | schema set on which xpath query should be executed |
xpathTemplate | Y | String | xpath template |
apiType | Y | String | API type to be used towards CPS (get, query, edit) |
Get a xpath template by id
Interface definition | Description |
---|
Content-Type | application/json |
Operation | GET |
URI | /api/v1/templates/{schema}/{id} |
Response Codes
Code | Description |
---|
200 | Template found and returned |
404 | Template not found |
500 | Internal server error |
Response Body
Same as template Object
Delete xpath template
Interface definition | Description |
---|
Content-Type | application/json |
Operation | DELETE |
URI | /api/v1/templates/{schema}/{id} |
Response Codes
Code | Description |
---|
200 | Template deleted successfully |
400 | Bad Request (Error in request attributes) |
500 | Internal server error |
Execute template
Interface definition | Description |
---|
Content-Type | application/json |
Operation | POST |
URI | /api/v1/execute/{schema}/{id} |
Request Body
Attribute | Required | Type | Description |
---|
input | 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 |
4. Dependencies
Definition of templates
Sample xpath query
/NearRTRIC[idNearRTRIC=11]/GNBDUFunction[idGNBDUFunction=1]/NRCellDU[idNRCellDU=15296]/attributes/RRMPolicyRatio[id=123]
Sample xpath template
/NearRTRIC[idNearRTRIC={{nearrtric_id}}]/GNBDUFunction[idGNBDUFunction={{gnbdu_id}}]/NRCellDU[idNRCellDU={{nrcelldu_id}}]/attributes/RRMPolicyRatio[id={{rrmpolicy_id}}]
Sample API for above template
Response Object
TEMPLATE TABLE :(existing)
templateId | model | xpathTemplate | requestType |
---|
1 | ran-network | /NearRTRIC | get |
2 | ran-network | /NearRTRIC[idNearRTRIC={{nearrtric_id}}] | get |
TRANSFORMATION TABLE:(proposed)
transformationId | templateId | request | transformParam |
---|
1 | 1 | TrakingArea | idNearRTRIC |
2 | 2 | TrakingArea | attributes |
3 | 2 | TrakingArea | trakingArea |
6. Deployment aspects
To be updated