GET /v2/loop/getAllNames
org.onap.policy.clamp.loop.LoopController.getLoopNames()
return: java.lang.String[]
...
Clamp is also used as router, so several end points are just redirection to Api and Pap and could be removed. Policy-guy could use an external router/gateway or direct call. Anyway clamp is still need to call Api and Pap.
Model
Clamp uses its domain objects (JPA entities) directly in its REST endpoints. Controllers receive the body (in POST and PUT) as JsonArray.
Security
Users are store into clds/clds-users.json, it contains user, password and permissions. to handle permission clamp is using Spring Security.
Users and permissions should be decouple using roles and the application should be use Spring Security annotations.
Properties
- clamp runtime: multi properties file and mapping implemented manually
- clamp runtime acm: properties file is automatically mapped to a Properties bean using @ConfigurationPropertiesScan and @ConfigurationProperties. Multi properties file is already supported by SpringBoot using @PropertySource.
Logging
- clamp runtime: for each end point calls a Java method to log description of the endpoint (e.g. "Create Loop" and "Successful" when finished) and to insert into MDC "X-ONAP-RequestID", "X-ONAP-InvocationID" and "X-ONAP-PartnerName"
- clamp runtime acm: using RequestResponseLoggingFilter filter class we can log the url (e.g. "POST /v2/loop/create/{loopName}?templateName={templateName}" and "Successful" when finished) and insert into MDC "X-ONAP-RequestID", "X-ONAP-InvocationID" and "X-ONAP-PartnerName"
...