summaryrefslogtreecommitdiffstats
path: root/src/main/resources/clds/camel/rest
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2020-02-18 02:00:11 -0800
committerSébastien Determe <sebastien.determe@intl.att.com>2020-02-25 10:57:35 +0000
commitaa486be66b1c29ad2e953cb44d105ca1bde40b1c (patch)
treeb5893560b1eee8f1e456104deec7924f05e4fbfb /src/main/resources/clds/camel/rest
parent4e8e11afced0693e24074fd6bb8d5b2cace98ab6 (diff)
Modify the Ui
Modify the Ui to have a modify option in the menu so that the user can tune the loop instance Issue-ID: CLAMP-648 Change-Id: I57523bc1c3afaf5ca5a2acf5c59823df06fd4cd9 Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Diffstat (limited to 'src/main/resources/clds/camel/rest')
-rw-r--r--src/main/resources/clds/camel/rest/clamp-api-v2.xml103
1 files changed, 91 insertions, 12 deletions
diff --git a/src/main/resources/clds/camel/rest/clamp-api-v2.xml b/src/main/resources/clds/camel/rest/clamp-api-v2.xml
index f2db72cb8..d62a0c289 100644
--- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml
+++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml
@@ -569,6 +569,50 @@
</route>
</get>
+ <put uri="/v2/loop/addOperationaPolicy/{loopName}/policyModel/{policyType}/{policyVersion}"
+ outType="org.onap.clamp.loop.Loop" produces="application/json">
+ <route>
+ <removeHeaders pattern="*" excludePattern="loopName" />
+ <doTry>
+ <log loggingLevel="INFO"
+ message="ADD OperationalPolicy request for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'ADD OperationalPolicy request')" />
+ <to
+ uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','write')" />
+ <to uri="direct:load-loop" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('ADD OperationalPolicy request','INFO',${exchangeProperty[loopObject]})" />
+ <doTry>
+ <to
+ uri="bean:org.onap.clamp.loop.LoopService?method=addOperationalPolicy(${loopName},${policyType},${policyVersion})" />
+
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('ADD OperationalPolicy request successfully executed','INFO',${exchangeProperty[loopObject]})" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
+ </doTry>
+ <doCatch>
+ <exception>java.lang.Exception</exception>
+ <handled>
+ <constant>false</constant>
+ </handled>
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
+ <log loggingLevel="ERROR"
+ message="ADD OperationalPolicy request failed for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('ADD OperationalPolicy request, Error reported: ${exception} - Body: ${exception.responseBody}','ERROR',${exchangeProperty[loopObject]})" />
+ </doCatch>
+ <doFinally>
+ <setBody>
+ <simple>${exchangeProperty[loopObject]}</simple>
+ </setBody>
+ </doFinally>
+ </doTry>
+ </route>
+ </put>
+
<get uri="/v2/dictionary"
outType="org.onap.clamp.tosca.Dictionary" produces="application/json">
<route>
@@ -782,19 +826,19 @@
</doTry>
</route>
</get>
- <get uri="/v2/policyToscaModels/{policyModelType}"
+ <get uri="/v2/policyToscaModels/{policyModelType}/{policyModelVersion}"
outType="org.onap.clamp.loop.template.PolicyModel"
produces="application/json">
<route>
<removeHeaders pattern="*"
- excludePattern="policyModelType" />
+ excludePattern="policyModelType|policyModelVersion" />
<doTry>
<to
- uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Tosca Policy Model by Name')" />
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Tosca Policy Model by Name/Version')" />
<to
uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
<to
- uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getPolicyModelByType(${header.policyModelType})" />
+ uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getPolicyModelByType(${header.policyModelType},${header.policyModelVersion})" />
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
<doCatch>
@@ -814,18 +858,18 @@
</doTry>
</route>
</get>
- <get uri="/v2/policyToscaModels/yaml/{policyModelType}"
+ <get uri="/v2/policyToscaModels/yaml/{policyModelType}/{policyModelVersion}"
outType="java.lang.String" produces="application/json">
<route>
<removeHeaders pattern="*"
- excludePattern="policyModelType" />
+ excludePattern="policyModelType|policyModelVersion" />
<doTry>
<to
- uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Tosca Policy Model Yaml String by Name')" />
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'GET Tosca Policy Model Yaml String by Name/Version')" />
<to
uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','read')" />
<to
- uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getPolicyModelTosca(${header.policyModelType})" />
+ uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=getPolicyModelTosca(${header.policyModelType},${header.policyModelVersion})" />
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
<doCatch>
@@ -846,7 +890,7 @@
</route>
</get>
- <put uri="/v2/policyToscaModels/{policyModelType}"
+ <post uri="/v2/policyToscaModels/{policyModelType}"
type="java.lang.String"
outType="org.onap.clamp.loop.template.PolicyModel"
consumes="plain/text" produces="application/json">
@@ -858,11 +902,11 @@
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Upload New or Update Tosca Policy Model')" />
<to
uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
- <setProperty propertyName="PolicyModelObject">
+ <setProperty propertyName="PolicyModelTosca">
<simple>${body}</simple>
</setProperty>
<to
- uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=saveOrUpdateByPolicyModelType(${header.policyModelType},${exchangeProperty[PolicyModelObject]})" />
+ uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=createNewPolicyModelFromTosca(${header.policyModelType},${exchangeProperty[PolicyModelTosca]})" />
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
<doCatch>
@@ -881,9 +925,44 @@
</doCatch>
</doTry>
</route>
+ </post>
+ <put uri="/v2/policyToscaModels/{policyModelType}/{policyModelVersion}"
+ type="java.lang.String"
+ outType="org.onap.clamp.loop.template.PolicyModel"
+ consumes="plain/text" produces="application/json">
+ <route>
+ <removeHeaders pattern="*"
+ excludePattern="policyModelType|policyModelVersion" />
+ <doTry>
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Upload New or Update Tosca Policy Model')" />
+ <to
+ uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'tosca','','update')" />
+ <setProperty propertyName="PolicyModelTosca">
+ <simple>${body}</simple>
+ </setProperty>
+ <to
+ uri="bean:org.onap.clamp.loop.template.PolicyModelsService?method=updatePolicyModelTosca(${header.policyModelType},${policyModelVersion},${exchangeProperty[PolicyModelTosca]})" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
+ <doCatch>
+ <exception>java.lang.Exception</exception>
+ <handled>
+ <constant>true</constant>
+ </handled>
+ <setHeader headerName="CamelHttpResponseCode">
+ <constant>404</constant>
+ </setHeader>
+ <transform>
+ <simple>ERROR: ${exception.message}</simple>
+ </transform>
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
+ </doCatch>
+ </doTry>
+ </route>
</put>
-
<get uri="/v2/templates"
outType="org.onap.clamp.loop.template.LoopTemplate"
produces="application/json">