SDN-C Context Builder Application
Configuration
Configuration of the SDN-C Context Builder is done via config/application.properties (TODO: to be updated when SDNC Context Builder can be installed by OOM)
SDNC Connection
# SDNC REST Client Configuration
sdnc.serviceName=<IP address for connecting to SDNC>
sdnc.servicePort=<Port for connecting to SDNC>
sdnc.httpProtocol=http
sdnc.user=<username for connecting to SDNC>
sdnc.password=<obfuscated password for connecting to SDNC>
sdnc.connectionTimeout=5000
sdnc.readTimeout=1000
sdnc.genericResourcePath=/restconf/config/GENERIC-RESOURCE-API:services/service/{0}
Provide basic authorization
# HTTP Basic Authorization credentials for Rest Service API
sdncCtxBuilder.userId=<username for basic authorization>
sdncCtxBuilder.password=<password for basic authorization>
Interfaces/API
The SDN-C Context builder supports the use of the GENERIC-RESPONSE-API and VNF-API on the SDN-C
URI example using GENERIC-RESPONSE-API
SDC Context Builder URI example for GENERIC-RESPONSE-API
http://10.147.113.136:8080/sdnccontextbuilder/v1/service/context?serviceInstanceId=68352304-7bba-4609-8551-0d0b819376c3
JSON response GENERIC-RESPONSE-API example
JSON response GENERIC-RESPONSE-API example
URI example for VNF-API
URI example for VNF-API
JSON response example fro VNF-API
JSON response example fro VNF-API
API Configuration
The following refers to the ONAP code for SdncContextBuilder in https://gerrit.onap.org/r/#/admin/projects/logging-analytics/pomba/pomba-sdnc-context-builder.
Configuration of the API (currently only GENERIC-RESOURCE-API and VNF-API) is done through the following configuration files.
config/dynamic/conf/api-handlers.xml
This file is used to identify the Handler Beans (Java classes) that get invoked for the various API. New API Beans can be added here after the Java Classes are coded and built into the image.
api-handlers.xml
config/dynamic/routes/sdnc-api.route
Used to map a name (in this case the API name) to the previously defined Handler Beans. New Handler Beans need to be mapped here.
sdnc-api.route
config/rules/api-mapping-rules.drl
Rules logic to select the Mapping and hence the Handler Bean based on the ServiceEntity.serviceType that is extracted from the resourceLink by RestUtil.createServiceEntityObj().
No Java changes are required to implement theses rules.
api-mapping-rules.drl
Error Code
Error Code | Description | Resolution |
---|---|---|
400 | missing AppId from the header | Provide AppId in the header and re-send the request |
401 | missing basic auth from the header | Provide basic authorization in the header and re-send the request |