aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/resources
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/resources')
-rw-r--r--src/main/resources/META-INF/resources/designer/partials/portfolios/operational_policy_window.html33
-rw-r--r--src/main/resources/META-INF/resources/designer/scripts/OperationalPolicyCtrl.js212
-rw-r--r--src/main/resources/META-INF/resources/designer/scripts/propertyController.js4
-rw-r--r--src/main/resources/application-noaaf.properties5
-rw-r--r--src/main/resources/application.properties5
-rw-r--r--src/main/resources/clds/camel/rest/clamp-api-v2.xml126
-rw-r--r--src/main/resources/clds/camel/routes/flexible-flow.xml242
7 files changed, 456 insertions, 171 deletions
diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/operational_policy_window.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/operational_policy_window.html
index b7864eca9..db81e4760 100644
--- a/src/main/resources/META-INF/resources/designer/partials/portfolios/operational_policy_window.html
+++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/operational_policy_window.html
@@ -2,7 +2,7 @@
============LICENSE_START=======================================================
ONAP CLAMP
================================================================================
- Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
+ Copyright (C) 2017-2019 AT&T Intellectual Property. All rights
reserved.
================================================================================
Licensed under the Apache License, Version 2.0 (the "License");
@@ -291,7 +291,7 @@ label {
Type</label>
<div class="col-sm-8">
<select class="form-control" name="type" id="type"
- ng-click="initTargetResourceId()" ng-model="type">
+ ng-click="initTargetResourceId($event)" ng-model="type">
<option value="">-- choose an option --</option>
<option value="VFModule">VFModule</option>
<option value="VM">VM</option>
@@ -304,10 +304,9 @@ label {
Target ResourceId</label>
<div class="col-sm-8">
<select class="form-control" name="resourceId" id="resourceId"
- enableFilter="true" ng-click="changeTargetResourceId()"
+ enableFilter="true" ng-click="changeTargetResourceId($event)"
ng-model="resourceId">
<option value="">-- choose an option --</option>
- <option value="Other:">Other:</option>
</select>
</div>
</div>
@@ -404,34 +403,34 @@ label {
</div>
<div class="form-group clearfix">
- <label for="guardTargets" class="col-sm-4 control-label">Guard
+ <label for="targets" class="col-sm-4 control-label">Guard
targets</label>
<div class="col-sm-8">
- <input class="form-control" name="guardTargets" id="guardTargets" />
+ <input class="form-control" name="targets" id="targets" />
</div>
</div>
<div class="form-group clearfix" id="minMaxGuardPolicyDiv">
- <label for="minGuard" class="col-sm-4 control-label"> Min
+ <label for="min" class="col-sm-4 control-label"> Min
Guard</label>
<div class="col-sm-8">
- <input class="form-control" name="minGuard" id="minGuard" />
+ <input class="form-control" name="min" id="min" />
</div>
- <label for="maxGuard" class="col-sm-4 control-label"> Max
+ <label for="max" class="col-sm-4 control-label"> Max
Guard</label>
<div class="col-sm-8">
- <input class="form-control" name="maxGuard" id="maxGuard" />
+ <input class="form-control" name="max" id="max" />
</div>
</div>
<div class="form-group clearfix"
id="frequencyLimiterGuardPolicyDiv" style="display: none">
- <label for="limitGuard" class="col-sm-4 control-label">Limit</label>
+ <label for="limit" class="col-sm-4 control-label">Limit</label>
<div class="col-sm-8">
- <input class="form-control" name="limitGuard" id="limitGuard" />
+ <input class="form-control" name="limit" id="limit" />
</div>
<div class="col-sm-8">
- <select class="form-control" name="timeUnitsGuard"
- id="timeUnitsGuard">
+ <select class="form-control" name="timeUnits"
+ id="timeUnits">
<option value=""></option>
<option value="minute">minute</option>
<option value="hour">hour</option>
@@ -440,12 +439,12 @@ label {
<option value="month">month</option>
<option value="year">year</option>
- </select> <label for="timeWindowGuard" class="col-sm-4 control-label">Time
+ </select> <label for="timeWindow" class="col-sm-4 control-label">Time
Window</label>
</div>
<div class="col-sm-8">
- <input class="form-control" name="timeWindowGuard"
- id="timeWindowGuard" />
+ <input class="form-control" name="timeWindow"
+ id="timeWindow" />
</div>
</div>
<div class="form-group clearfix">
diff --git a/src/main/resources/META-INF/resources/designer/scripts/OperationalPolicyCtrl.js b/src/main/resources/META-INF/resources/designer/scripts/OperationalPolicyCtrl.js
index 2c3f83e41..0cf4c2e3a 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/OperationalPolicyCtrl.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/OperationalPolicyCtrl.js
@@ -2,7 +2,7 @@
* ============LICENSE_START=======================================================
* ONAP CLAMP
* ================================================================================
- * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights
+ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -55,7 +55,6 @@ app
}
console.log("No active formId found !");
}
-
function add_one_more() {
console.log("add one more");
@@ -154,10 +153,9 @@ app
policiesArray.push(policyProperties);
// Now get the Guard
if ($("#" + this.id + " #enableGuardPolicy").is(':checked')) {
- var guardPolicyBody = serializeElement($("#" + this.id + " .guardProperties"));
- var guardPolicyId = guardPolicyBody['id'];
- delete guardPolicyBody['id'];
-
+ var guardPolicyBody = serializeElement($("#" + this.id + " .guardProperties"));
+ var guardPolicyId = guardPolicyBody['id'];
+ delete guardPolicyBody['id'];
allPolicies['guard_policies'][guardPolicyId] = guardPolicyBody;
$scope.guard_ids.push(guardPolicyId);
}
@@ -190,9 +188,14 @@ app
var formNum = add_one_more();
$.each($('.policyProperties').find('.form-control'), function(opPolicyPropIndex, opPolicyPropValue) {
- $("#formId"+formNum+" .policyProperties").find("#"+opPolicyPropValue.id).val(
+ $("#formId" + formNum + " .policyProperties").find("#" + opPolicyPropValue.id).val(
allPolicies['operational_policy']['policies'][opPolicyElemIndex][opPolicyPropValue.id]);
});
+ $.each($('.policyTarget').find('.form-control'), function(opPolicyTargetPropIndex, opPolicyTargetPropValue) {
+
+ $("#formId" + formNum + " .policyTarget").find("#" + opPolicyTargetPropValue.id).val(
+ allPolicies['operational_policy']['policies'][opPolicyElemIndex]['target'][opPolicyTargetPropValue.id]);
+ });
// update the current tab label
$("#go_properties_tab" + formNum).text(
allPolicies['operational_policy']['policies'][opPolicyElemIndex]['id']);
@@ -201,9 +204,11 @@ app
if (guardElemValue.recipe === $($("#formId" + formNum + " #recipe")[0]).val()) {
// Found one, set all guard prop
- $.each($('.guardProperties').find('.form-control'), function(guardPropElemIndex,guardPropElemValue) {
- guardElemValue['id'] = guardElemId;
- $("#formId"+formNum+" .guardProperties").find("#"+guardPropElemValue.id).val(
+ $.each($('.guardProperties').find('.form-control'), function(guardPropElemIndex,
+ guardPropElemValue) {
+
+ guardElemValue['id'] = guardElemId;
+ $("#formId" + formNum + " .guardProperties").find("#" + guardPropElemValue.id).val(
guardElemValue[guardPropElemValue.id]);
});
// And finally enable the flag
@@ -212,108 +217,69 @@ app
});
});
}
-
- $scope.initTargetResourceId = function() {
-
- var recipe = $(event.target).val();
-
- var type = $(event.target).val();
-
- $("#modelName").val("");
- $("#modelInvariantId").val("");
- $("#modelVersionId").val("");
- $("#modelVersion").val("");
- $("#modelCustomizationId").val("");
- $('#resourceId').empty();
- $("#resourceId")
- .append(
- $('<option></option>').val("")
- .html("-- choose an option --"));
- $("#resourceId").append(
- $('<option></option>').val("Other:")
- .html("Other:"));
- if (type == "VM" || type == "" || type == "VNF" ) {
- $("#metadata *").prop('disabled',true);
- }
-
- var resourceVnf = getResourceDetailsProperty();
- if (type == "VNF"
- && (null !== resourceVnf || undefined !== resourceVnf)) {
- for ( var prop in resourceVnf) {
- var name = resourceVnf[prop]["name"];
- $("#resourceId").append(
- $('<option></option>')
- .val(name).html(name));
- }
-
- }
- var resourceVFModule = getResourceDetailsVfModuleProperty();
- if (type == "VFModule"
- && (null !== resourceVFModule || undefined !== resourceVFModule)) {
- if (recipe == 'VF Module Create'
- || recipe == 'VF Module Delete') {
- for ( var prop in resourceVFModule) {
- if (resourceVFModule[prop]["isBase"] == false) {
- var name = resourceVFModule[prop]["name"];
- $("#resourceId").append(
- $('<option></option>')
- .val(name)
- .html(name));
- }
- }
- }
- else
- {
- for ( var prop in resourceVFModule) {
- var name = resourceVFModule[prop]["name"];
- $("#resourceId").append(
- $('<option></option>')
- .val(name).html(name));
- }
- }
- }
- }
-
- $scope.changeTargetResourceId = function() {
- $("#modelName").val("");
- $("#modelInvariantId").val("");
- $("#modelVersionId").val("");
- $("#modelVersion").val("");
- $("#modelCustomizationId").val("");
- var resourceVFModule = getResourceDetailsVfModuleProperty();
- var type = $("#type").val();
- var recipe = $("#recipe").val();
- vfBaseName = $(event.target).val();
- if (type == "VFModule"
- && (null !== resourceVFModule || undefined !== resourceVFModule)
- && (recipe == 'VF Module Create' || recipe == 'VF Module Delete')) {
- for ( var prop in resourceVFModule) {
- var name = resourceVFModule[prop]["name"];
- if (name == vfBaseName) {
- var vfModuleModelName = resourceVFModule[prop]["name"];
- $("#modelName").val(
- vfModuleModelName);
- var vfModuleModelInvariantUUID = resourceVFModule[prop]["invariantUUID"];
- $("#modelInvariantId").val(
- vfModuleModelInvariantUUID);
- var vfModuleModelUUID = resourceVFModule[prop]["UUID"];
- $("#modelVersionId").val(
- vfModuleModelUUID);
- var vfModuleModelVersion = resourceVFModule[prop]["version"];
- $("#modelVersion").val(
- vfModuleModelVersion);
- var vfModuleModelCustomizationUUID = resourceVFModule[prop]["customizationUUID"];
- $("#modelCustomizationId")
- .val(
- vfModuleModelCustomizationUUID);
- }
- }
- }
- else {
- $("#metadata *").prop('disabled',true);
- }
- }
-
+ $scope.initTargetResourceId = function(event) {
+ var formNum = $(event.target).closest('.formId').attr('id').substring(6);
+
+ var type = $(event.target).val();
+ var recipe = $("#formId" + formNum + "#recipe").val();
+ $("#formId" + formNum + " #modelName").val("");
+ $("#formId" + formNum + " #modelInvariantId").val("");
+ $("#formId" + formNum + " #modelVersionId").val("");
+ $("#formId" + formNum + " #modelVersion").val("");
+ $("#formId" + formNum + " #modelCustomizationId").val("");
+ $("#formId" + formNum + " #resourceId").empty();
+ $("#formId" + formNum + " #resourceId").append($('<option></option>').val("").html("-- choose an option --"));
+ if (type == "VM" || type == "" || type == "VNF") {
+ $("#formId" + formNum + " #metadata *").prop('disabled', true);
+ }
+ var resourceVnf = getResourceDetailsVfProperty();
+ if (type == "VNF" && (null !== resourceVnf || undefined !== resourceVnf)) {
+ for ( var prop in resourceVnf) {
+ var name = resourceVnf[prop]["name"];
+ $("#formId" + formNum + " #resourceId").append($('<option></option>').val(name).html(name));
+ }
+ }
+ var resourceVFModule = getResourceDetailsVfModuleProperty();
+ if (type == "VFModule" && (null !== resourceVFModule || undefined !== resourceVFModule)) {
+ if (recipe == 'VF Module Create' || recipe == 'VF Module Delete') {
+ for ( var prop in resourceVFModule) {
+ if (resourceVFModule[prop]["isBase"] == false) {
+ $("#formId" + formNum + " #resourceId").append($('<option></option>').val(resourceVFModule[prop]["vfModuleModelName"]).html(resourceVFModule[prop]["vfModuleModelName"]));
+ }
+ }
+ } else {
+ for ( var prop in resourceVFModule) {
+ $("#formId" + formNum + " #resourceId").append($('<option></option>').val(resourceVFModule[prop]["vfModuleModelName"]).html(resourceVFModule[prop]["vfModuleModelName"]));
+ }
+ }
+ }
+ }
+ $scope.changeTargetResourceId = function(event) {
+ var formNum = $(event.target).closest('.formId').attr('id').substring(6);
+ $("#formId" + formNum +" #modelName").val("");
+ $("#formId" + formNum +" #modelInvariantId").val("");
+ $("#formId" + formNum +" #modelVersionId").val("");
+ $("#formId" + formNum +" #modelVersion").val("");
+ $("#formId" + formNum +" #modelCustomizationId").val("");
+ var resourceVFModule = getResourceDetailsVfModuleProperty();
+ var type = $("#formId" + formNum +" #type").val();
+ var recipe = $("#formId" + formNum +" #recipe").val();
+ if (type == "VFModule" && (null !== resourceVFModule || undefined !== resourceVFModule)
+ && (recipe == 'VF Module Create' || recipe == 'VF Module Delete')) {
+ for ( var prop in resourceVFModule) {
+ if (prop == $(event.target).val()) {
+ $("#formId" + formNum +" #modelName").val(resourceVFModule[prop]["vfModuleModelName"]);
+ $("#formId" + formNum +" #modelInvariantId").val(resourceVFModule[prop]["vfModuleModelInvariantUUID"]);
+ $("#formId" + formNum +" #modelVersionId").val(resourceVFModule[prop]["vfModuleModelUUID"]);
+ $("#formId" + formNum +" #modelVersion").val(resourceVFModule[prop]["vfModuleModelVersion"]);
+ $("#formId" + formNum +" #modelCustomizationId").val(resourceVFModule[prop]["vfModuleModelCustomizationUUID"]);
+ $("#formId" + formNum +" #metadata *").prop('disabled', false);
+ }
+ }
+ } else {
+ $("#formId" + formNum +" #metadata *").prop('disabled', true);
+ }
+ }
$scope.changeGuardPolicyType = function() {
var formItemActive = searchActiveFormId();
@@ -343,7 +309,8 @@ app
$scope.init = function() {
$(function() {
- $scope.clname=getLoopName();
+
+ $scope.clname = getLoopName();
$("#add_one_more").click(function(event) {
console.log("add one more");
@@ -359,17 +326,18 @@ app
add_new_policy();
}
$("#savePropsBtn").click(function(event) {
+
console.log("save properties triggered");
savePolicyLocally();
- for(var i = 0; i <= $scope.guard_ids.length; i++) {
- for(var j = i; j <= $scope.guard_ids.length; j++) {
- if(i != j && $scope.guard_ids[i] == $scope.guard_ids[j]) {
- // duplacated guard policy id exist
- alert("The guard policy ID should be unique.");
- return;
- }
- }
- }
+ for (var i = 0; i <= $scope.guard_ids.length; i++) {
+ for (var j = i; j <= $scope.guard_ids.length; j++) {
+ if (i != j && $scope.guard_ids[i] == $scope.guard_ids[j]) {
+ // duplacated guard policy id exist
+ alert("The guard policy ID should be unique.");
+ return;
+ }
+ }
+ }
angular.element(document.getElementById('formSpan')).scope().submitForm(allPolicies);
$("#close_button").click();
});
diff --git a/src/main/resources/META-INF/resources/designer/scripts/propertyController.js b/src/main/resources/META-INF/resources/designer/scripts/propertyController.js
index 3902cf413..ee602b993 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/propertyController.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/propertyController.js
@@ -114,7 +114,7 @@ function setDeploymentStatusURL(deploymentStatusURL) {
cl_props["dcaeDeploymentStatusUrl"] = deploymentStatusURL;
}
-function getResourceDetailsProperty() {
+function getResourceDetailsVfProperty() {
return cl_props["modelPropertiesJson"]["resourceDetails"]["VF"];
}
@@ -126,4 +126,4 @@ function getLoopLogsArray() {
return cl_props.loopLogs;
}
-module.exports = { getOperationalPolicyProperty,getGlobalProperty,getMsProperty,getMsUI,getLastUpdatedStatus,getDeploymentID,getDeploymentStatusURL,getResourceDetailsProperty,getResourceDetailsVfModuleProperty }; \ No newline at end of file
+module.exports = { getOperationalPolicyProperty,getGlobalProperty,getMsProperty,getMsUI,getLastUpdatedStatus,getDeploymentID,getDeploymentStatusURL,getResourceDetailsVfProperty,getResourceDetailsVfModuleProperty }; \ No newline at end of file
diff --git a/src/main/resources/application-noaaf.properties b/src/main/resources/application-noaaf.properties
index de3f7c07a..52f79bef4 100644
--- a/src/main/resources/application-noaaf.properties
+++ b/src/main/resources/application-noaaf.properties
@@ -210,6 +210,11 @@ clamp.config.dcae.dispatcher.url=http://dcae.api.simpledemo.onap.org:8188
clamp.config.dcae.dispatcher.retry.interval=20000
clamp.config.dcae.dispatcher.retry.limit=30
+#DCAE Deployment Url Properties
+clamp.config.dcae.deployment.url=http4://dcae.api.simpledemo.onap.org:8188
+clamp.config.dcae.deployment.userName=test
+clamp.config.dcae.deployment.password=test
+
#Define user permission related parameters, the permission type can be changed but MUST be redefined in clds-users.properties in that case !
clamp.config.security.permission.type.cl=org.onap.clamp.clds.cl
clamp.config.security.permission.type.cl.manage=org.onap.clamp.clds.cl.manage
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index f59b8ac64..534dc4818 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -228,6 +228,11 @@ clamp.config.dcae.dispatcher.url=http://dcae.api.simpledemo.onap.org:8188
clamp.config.dcae.dispatcher.retry.interval=20000
clamp.config.dcae.dispatcher.retry.limit=30
+#DCAE Deployment Url Properties
+clamp.config.dcae.deployment.url=http4://dcae.api.simpledemo.onap.org:8188
+clamp.config.dcae.deployment.userName=test
+clamp.config.dcae.deployment.password=test
+
#Define user permission related parameters, the permission type can be changed but MUST be redefined in clds-users.properties in that case !
clamp.config.security.permission.type.cl=org.onap.clamp.clds.cl
clamp.config.security.permission.type.cl.manage=org.onap.clamp.clds.cl.manage
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 5c5f122cd..1883145d7 100644
--- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml
+++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml
@@ -202,11 +202,35 @@
excludePattern="loopName" />
<doTry>
<to
- uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Deploy the closed loop')" />
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'DEPLOY the closed loop')" />
<to
uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
+ <to uri="direct:load-loop" />
+ <to uri="direct:get-status-from-policy" />
+ <to uri="direct:get-status-from-dcae" />
+ <log
+ loggingLevel="INFO"
+ message="Policy deployment status: ${exchangeProperty[policyStatus]}"></log>
+ <choice>
+ <when>
+ <simple> ${exchangeProperty[policyStatus]} == 'SUBMITTED' and
+ ${exchangeProperty[dcaeStatus]} == 'NOT_DEPLOYED'
+ </simple>
+ <to uri="direct:deploy-closedloop" />
+ </when>
+ <otherwise>
+ <log
+ loggingLevel="INFO"
+ message="Closed Loop is in state ${exchangeProperty[policyStatus]}, it can only be deployed when in state SUBMIT" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Closed Loop is in state ${exchangeProperty[policyStatus]}, it can only be deployed when in state SUBMIT','ERROR',${exchangeProperty[loopObject]})" />
+ </otherwise>
+ </choice>
+ <log
+ loggingLevel="INFO"
+ message="DEPLOY request successfully executed for loop: ${header.loopName}" />
<to
- uri="bean:org.onap.clamp.operation.LoopOperation?method=deployLoop(*,${header.loopName})" />
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DEPLOY request successfully executed','INFO',${exchangeProperty[loopObject]})" />
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
<doCatch>
@@ -216,6 +240,11 @@
</handled>
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
+ <log
+ loggingLevel="ERROR"
+ message="DEPLOY request failed for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DEPLOY request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
</doCatch>
</doTry>
</route>
@@ -233,8 +262,27 @@
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Undeploy the closed loop')" />
<to
uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
+ <to uri="direct:load-loop" />
+ <to uri="direct:get-status-from-dcae" />
+ <choice>
+ <when>
+ <simple> ${exchangeProperty[dcaeStatus]} == 'DEPLOYED'
+ </simple>
+ <to uri="direct:undeploy-closedloop" />
+ </when>
+ <otherwise>
+ <log
+ loggingLevel="INFO"
+ message="Closed Loop is in state ${exchangeProperty[dcaeStatus]}, it can only be undeployed when in state DEPLOYED" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Closed Loop is in state ${exchangeProperty[dcaeStatus]}, it can only be deployed when in state DEPLOYED','ERROR',${exchangeProperty[loopObject]})" />
+ </otherwise>
+ </choice>
+ <log
+ loggingLevel="INFO"
+ message="UNDEPLOY request successfully executed for loop: ${header.loopName}" />
<to
- uri="bean:org.onap.clamp.operation.LoopOperation?method=unDeployLoop(${header.loopName})" />
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request successfully executed','INFO',${exchangeProperty[loopObject]})" />
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
<doCatch>
@@ -244,6 +292,11 @@
</handled>
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=errorLog()" />
+ <log
+ loggingLevel="ERROR"
+ message="UNDEPLOY request failed for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('UNDEPLOY request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
</doCatch>
</doTry>
</route>
@@ -268,12 +321,10 @@
<to uri="direct:remove-all-policy-from-active-pdp-group" />
<log
loggingLevel="INFO"
- message="STOP request successfully executed for loop: ${body}" />
+ message="STOP request successfully executed for loop: ${header.loopName}" />
<to
uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request successfully executed','INFO',${exchangeProperty[loopObject]})" />
<to
- uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
- <to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
<doCatch>
<exception>java.lang.Exception</exception>
@@ -286,7 +337,7 @@
loggingLevel="ERROR"
message="STOP request failed for loop: $${header.loopName}" />
<to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request failed','ERROR',${exchangeProperty[loopObject]})" />
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('STOP request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
</doCatch>
</doTry>
</route>
@@ -317,8 +368,6 @@
<to
uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('START request successfully executed','INFO',${exchangeProperty[loopObject]})" />
<to
- uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
- <to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
<doCatch>
<exception>java.lang.Exception</exception>
@@ -331,7 +380,7 @@
loggingLevel="ERROR"
message="START request failed for loop: ${header.loopName}" />
<to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('START request failed','INFO',${exchangeProperty[loopObject]})" />
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('START request failed, Error reported: ${exception}','INFO',${exchangeProperty[loopObject]})" />
</doCatch>
</doTry>
</route>
@@ -425,8 +474,6 @@
<to
uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request successfully executed','INFO',${exchangeProperty[loopObject]})" />
<to
- uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
- <to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
<doCatch>
<exception>java.lang.Exception</exception>
@@ -439,7 +486,7 @@
loggingLevel="ERROR"
message="SUBMIT request failed for loop: ${header.loopName}" />
<to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request failed','ERROR',${exchangeProperty[loopObject]})" />
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('SUBMIT request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
</doCatch>
</doTry>
</route>
@@ -521,10 +568,61 @@
loggingLevel="ERROR"
message="DELETE request failed for loop: ${header.loopName}" />
<to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request failed','ERROR',${exchangeProperty[loopObject]})" />
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('DELETE request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
</doCatch>
</doTry>
</route>
</put>
+ <get
+ uri="/v2/loop/getstatus/{loopName}"
+ outType="org.onap.clamp.loop.Loop"
+ produces="application/json">
+ <route>
+ <removeHeaders
+ pattern="*"
+ excludePattern="loopName" />
+ <doTry>
+ <log
+ loggingLevel="INFO"
+ message="Get current status for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=startLog(*, 'Get the closed loop status')" />
+ <to
+ uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
+ <to uri="direct:load-loop" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Receive GET STATUS request','INFO',${exchangeProperty[loopObject]})" />
+ <setProperty propertyName="raiseHttpExceptionFlag">
+ <simple resultType="java.lang.Boolean">false</simple>
+ </setProperty>
+ <to uri="direct:get-status-from-policy" />
+ <to uri="direct:get-status-from-dcae" />
+ <to
+ uri="bean:org.onap.clamp.loop.LoopOperation?method=updateLoopStatus(${exchangeProperty[loopObject]},${exchangeProperty[policyStatus]}, ${exchangeProperty[dcaeStatus]})" />
+ <log
+ loggingLevel="INFO"
+ message="Get Status request successfully executed. The new state is: ${body}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request successfully executed','INFO',${exchangeProperty[loopObject]})" />
+ <to
+ uri="bean:org.onap.clamp.loop.LoopController?method=getLoop(${header.loopName})" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
+ <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="Get Status request failed for loop: ${header.loopName}" />
+ <to
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('Get Status request failed, Error reported: ${exception}','ERROR',${exchangeProperty[loopObject]})" />
+ </doCatch>
+ </doTry>
+ </route>
+ </get>
</rest>
</rests>
diff --git a/src/main/resources/clds/camel/routes/flexible-flow.xml b/src/main/resources/clds/camel/routes/flexible-flow.xml
index 75341de93..920e1e549 100644
--- a/src/main/resources/clds/camel/routes/flexible-flow.xml
+++ b/src/main/resources/clds/camel/routes/flexible-flow.xml
@@ -133,7 +133,7 @@
loggingLevel="INFO"
message="Endpoint to create microservice policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies"></log>
<toD
- uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies?bridgeEndpoint=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
+ uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
<doFinally>
<to uri="direct:reset-raise-http-exception-flag" />
<to
@@ -178,7 +178,7 @@
loggingLevel="INFO"
message="Endpoint to delete microservice policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies/${exchangeProperty[microServicePolicy].getName()}/versions/1.0.0"></log>
<toD
- uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies/${exchangeProperty[microServicePolicy].getName()}/versions/1.0.0?bridgeEndpoint=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
+ uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/${exchangeProperty[microServicePolicy].getModelType()}/versions/1.0.0/policies/${exchangeProperty[microServicePolicy].getName()}/versions/1.0.0?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
<doFinally>
<to uri="direct:reset-raise-http-exception-flag" />
@@ -226,9 +226,9 @@
</setHeader>
<log
loggingLevel="INFO"
- message="Endpoint to create operational policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policy.controlloop.operational/versions/1.0.0/policies"></log>
+ message="Endpoint to create operational policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies"></log>
<toD
- uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policy.controlloop.operational/versions/1.0.0/policies?bridgeEndpoint=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
+ uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
<doFinally>
<to uri="direct:reset-raise-http-exception-flag" />
<to
@@ -271,9 +271,9 @@
</setHeader>
<log
loggingLevel="INFO"
- message="Endpoint to delete operational policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policy.controlloop.operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicy].getName()}/versions/1.0.0"></log>
+ message="Endpoint to delete operational policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicy].getName()}/versions/1.0.0"></log>
<toD
- uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policy.controlloop.operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicy].getName()}/versions/1.0.0?bridgeEndpoint=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
+ uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicy].getName()}/versions/1.0.0?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
<doFinally>
<to uri="direct:reset-raise-http-exception-flag" />
<to
@@ -320,9 +320,9 @@
</setHeader>
<log
loggingLevel="INFO"
- message="Endpoint to create guard policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policy.controlloop.guard/versions/1.0.0/policies"></log>
+ message="Endpoint to create guard policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies"></log>
<toD
- uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policy.controlloop.guard/versions/1.0.0/policies?bridgeEndpoint=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
+ uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
<doFinally>
<to uri="direct:reset-raise-http-exception-flag" />
<to
@@ -364,9 +364,9 @@
</setHeader>
<log
loggingLevel="INFO"
- message="Endpoint to delete guard policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policy.controlloop.guard/versions/1.0.0/policies/${exchangeProperty[guardPolicy].getKey()}/versions/1.0.0"></log>
+ message="Endpoint to delete guard policy: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/${exchangeProperty[guardPolicy].getKey()}/versions/1.0.0"></log>
<toD
- uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policy.controlloop.guard/versions/1.0.0/policies/${exchangeProperty[guardPolicy].getKey()}/versions/1.0.0?bridgeEndpoint=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
+ uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/${exchangeProperty[guardPolicy].getKey()}/versions/1.0.0?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;deleteWithBody=false&amp;mapHttpMessageBody=false&amp;mapHttpMessageFormUrlEncodedBody=false&amp;authUsername={{clamp.config.policy.api.userName}}&amp;authPassword={{clamp.config.policy.api.password}}" />
<doFinally>
<to uri="direct:reset-raise-http-exception-flag" />
@@ -413,9 +413,9 @@
</setHeader>
<log
loggingLevel="INFO"
- message="Endpoint to add policies to PDP Group: {{clamp.config.policy.pap.url}}/policy/pap/v1/pdps"></log>
+ message="Endpoint to add policies to PDP Group: {{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies"></log>
<toD
- uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps?throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}" />
+ uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies?bridgeEndpoint=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;useSystemProperties=true&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}" />
<doFinally>
<to uri="direct:reset-raise-http-exception-flag" />
@@ -465,7 +465,7 @@
loggingLevel="INFO"
message="Endpoint to delete policy from PDP Group: {{clamp.config.policy.pap.url}}/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0"></log>
<toD
- uri="{{clamp.config.policy.pap.url}}/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0?bridgeEndpoint=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}" />
+ uri="{{clamp.config.policy.pap.url}}/policy/pap/v1/pdps/policies/${exchangeProperty[policyName]}/versions/1.0.0?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}" />
<setProperty propertyName="logMessage">
<simple>${exchangeProperty[policyName]} PDP Group removal status
</simple>
@@ -478,8 +478,7 @@
<constant>false</constant>
</handled>
<setProperty propertyName="logMessage">
- <simple>${exchangeProperty[policyName]} PDP Group removal status
- </simple>
+ <simple>PDP Group removal, Error reported: ${exception}</simple>
</setProperty>
<to uri="direct:dump-loop-log-http-response" />
</doCatch>
@@ -490,7 +489,217 @@
</doFinally>
</doTry>
</route>
+ <route id="deploy-closedloop">
+ <from uri="direct:deploy-closedloop" />
+ <doTry>
+ <log
+ loggingLevel="INFO"
+ message="Deploy the closed loop: ${exchangeProperty[loopObject].getName()}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Deploy closed loop')" />
+ <setBody>
+ <method ref="org.onap.clamp.loop.LoopOperation"
+ method="getDeployPayload(${exchangeProperty[loopObject]})" />
+ </setBody>
+ <setProperty propertyName="deploymentId">
+ <method ref="org.onap.clamp.loop.LoopOperation"
+ method="getDeploymentId(${exchangeProperty[loopObject]})" />
+ </setProperty>
+ <setHeader headerName="CamelHttpMethod">
+ <constant>PUT</constant>
+ </setHeader>
+ <setHeader headerName="Content-Type">
+ <constant>application/json</constant>
+ </setHeader>
+ <setHeader headerName="X-ONAP-RequestID">
+ <simple>${exchangeProperty[X-ONAP-RequestID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-InvocationID">
+ <simple>${exchangeProperty[X-ONAP-InvocationID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-PartnerName">
+ <simple>${exchangeProperty[X-ONAP-PartnerName]}
+ </simple>
+ </setHeader>
+ <log
+ loggingLevel="INFO"
+ message="Endpoint to deploy closed loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[deploymentId]}"></log>
+ <toD
+ uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[deploymentId]}?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[RaiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.dcae.deployment.userName}}&amp;authPassword={{clamp.config.dcae.deployment.password}}" />
+ <to
+ uri="bean:org.onap.clamp.loop.LoopOperation?method=updateLoopInfo(*,${exchangeProperty[loopObject]},${exchangeProperty[deploymentId]})" />
+ <doFinally>
+ <to uri="direct:reset-raise-http-exception-flag" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
+ <setProperty propertyName="logMessage">
+ <simple>Deploy closed loop status</simple>
+ </setProperty>
+ <to uri="direct:dump-loop-log-http-response" />
+ </doFinally>
+ </doTry>
+ </route>
+ <route id="undeploy-closedloop">
+ <from uri="direct:undeploy-closedloop" />
+ <doTry>
+ <log
+ loggingLevel="INFO"
+ message="UNdeploy the closed loop: ${exchangeProperty[loopObject].getName()} : ${exchangeProperty[loopObject].getDcaeDeploymentId()}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('DCAE', 'Undeploy closed loop')" />
+
+ <setBody>
+ <simple>{\"serviceTypeId\": \"${exchangeProperty[loopObject].getDcaeBlueprintId()}\"}
+ </simple>
+ </setBody>
+ <setHeader headerName="CamelHttpMethod">
+ <constant>DELETE</constant>
+ </setHeader>
+ <setHeader headerName="Content-Type">
+ <constant>application/json</constant>
+ </setHeader>
+ <setHeader headerName="X-ONAP-RequestID">
+ <simple>${exchangeProperty[X-ONAP-RequestID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-InvocationID">
+ <simple>${exchangeProperty[X-ONAP-InvocationID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-PartnerName">
+ <simple>${exchangeProperty[X-ONAP-PartnerName]}
+ </simple>
+ </setHeader>
+ <log
+ loggingLevel="INFO"
+ message="Endpoint to undeploy closed loop: {{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[loopObject].getDcaeDeploymentId()}"></log>
+ <toD
+ uri="{{clamp.config.dcae.deployment.url}}/dcae-deployments/${exchangeProperty[loopObject].getDcaeDeploymentId()}?bridgeEndpoint=true&amp;useSystemProperties=true&amp;mapHttpMessageHeaders=false&amp;throwExceptionOnFailure=${exchangeProperty[RaiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;authUsername={{clamp.config.dcae.deployment.userName}}&amp;authPassword={{clamp.config.dcae.deployment.password}}" />
+ <to
+ uri="bean:org.onap.clamp.loop.LoopOperation?method=updateLoopInfo(*,${exchangeProperty[loopObject]},null)" />
+ <doFinally>
+ <to uri="direct:reset-raise-http-exception-flag" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
+ <setProperty propertyName="logMessage">
+ <simple>Undeploy closed loop status</simple>
+ </setProperty>
+ <to uri="direct:dump-loop-log-http-response" />
+ </doFinally>
+ </doTry>
+ </route>
+ <route id="get-status-from-policy">
+ <from uri="direct:get-status-from-policy" />
+ <doTry>
+ <log
+ loggingLevel="INFO"
+ message="Query Closed Loop status from policy PDP: ${exchangeProperty[loopObject].getName()}" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('Policy', 'Query operational policies to PDP group')" />
+ <setProperty propertyName="operationalPolicyName">
+ <method ref="org.onap.clamp.loop.LoopOperation"
+ method="getOperationalPolicyName(${exchangeProperty[loopObject]})" />
+ </setProperty>
+ <setHeader headerName="CamelHttpMethod">
+ <constant>GET</constant>
+ </setHeader>
+ <setHeader headerName="X-ONAP-RequestID">
+ <simple>${exchangeProperty[X-ONAP-RequestID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-InvocationID">
+ <simple>${exchangeProperty[X-ONAP-InvocationID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-PartnerName">
+ <simple>${exchangeProperty[X-ONAP-PartnerName]}
+ </simple>
+ </setHeader>
+ <log
+ loggingLevel="INFO"
+ message="Endpoint to query from Policy PDP: {{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicyName]}/versions/deployed"></log>
+ <toD
+ uri="{{clamp.config.policy.api.url}}/policy/api/v1/policytypes/onap.policies.controlloop.Operational/versions/1.0.0/policies/${exchangeProperty[operationalPolicyName]}/versions/deployed?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;authMethod=Basic&amp;authUsername={{clamp.config.policy.pap.userName}}&amp;authPassword={{clamp.config.policy.pap.password}}" />
+ <doFinally>
+ <to uri="direct:reset-raise-http-exception-flag" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
+ <setProperty propertyName="logMessage">
+ <simple>Query closed loop from Policy status</simple>
+ </setProperty>
+ <setProperty propertyName="policyStatus">
+ <method ref="org.onap.clamp.loop.LoopOperation"
+ method="analysePolicyResponse(${header.CamelHttpResponseCode})" />
+ </setProperty>
+ <to uri="direct:dump-loop-log-http-response" />
+ </doFinally>
+ </doTry>
+ </route>
+ <route id="get-status-from-dcae">
+ <from uri="direct:get-status-from-dcae" />
+ <log
+ loggingLevel="INFO"
+ message="Query Closed Loop status from DCAE ${exchangeProperty[loopObject].getName()}" />
+ <choice>
+ <when>
+ <simple>${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()} == null
+ </simple>
+ <setProperty propertyName="dcaeStatus">
+ <method ref="org.onap.clamp.loop.LoopOperation"
+ method="analyseDcaeResponse(*,null)" />
+ </setProperty>
+ <log
+ loggingLevel="INFO"
+ message="dcae status: ${exchangeProperty[dcaeStatus]}"></log>
+ </when>
+ <otherwise>
+ <doTry>
+ <log
+ loggingLevel="INFO"
+ message="Query Closed Loop status from Dcae" />
+ <setHeader headerName="CamelHttpMethod">
+ <constant>GET</constant>
+ </setHeader>
+ <setHeader headerName="X-ONAP-RequestID">
+ <simple>${exchangeProperty[X-ONAP-RequestID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-InvocationID">
+ <simple>${exchangeProperty[X-ONAP-InvocationID]}
+ </simple>
+ </setHeader>
+ <setHeader headerName="X-ONAP-PartnerName">
+ <simple>${exchangeProperty[X-ONAP-PartnerName]}
+ </simple>
+ </setHeader>
+ <log
+ loggingLevel="INFO"
+ message="Endpoint to query Closed Loop status: ${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()}"></log>
+ <toD
+ uri="${exchangeProperty[loopObject].getDcaeDeploymentStatusUrl()}?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;httpClient.connectTimeout=10000&amp;authMethod=Basic&amp;authUsername={{clamp.config.dcae.deployment.userName}}&amp;authPassword={{clamp.config.dcae.deployment.password}}" />
+ <doFinally>
+ <to uri="direct:reset-raise-http-exception-flag" />
+ <to
+ uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()" />
+ <setProperty propertyName="logMessage">
+ <simple>Query closed loop from DCAE status</simple>
+ </setProperty>
+ <setProperty propertyName="dcaeStatus">
+ <method ref="org.onap.clamp.loop.LoopOperation"
+ method="analyseDcaeResponse(*,${header.CamelHttpResponseCode})" />
+ </setProperty>
+ <log
+ loggingLevel="INFO"
+ message="dcae status: ${exchangeProperty[dcaeStatus]}"></log>
+ <to uri="direct:dump-loop-log-http-response" />
+ </doFinally>
+ </doTry>
+ </otherwise>
+ </choice>
+ </route>
<route id="reset-raise-http-exception-flag">
<from uri="direct:reset-raise-http-exception-flag" />
<setProperty propertyName="raiseHttpExceptionFlag">
@@ -500,7 +709,8 @@
<route id="dump-loop-log-http-response">
<from uri="direct:dump-loop-log-http-response" />
+ <log loggingLevel="INFO" message="${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}" />
<to
- uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog(${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText},'INFO',${exchangeProperty[loopObject]})" />
+ uri="bean:org.onap.clamp.loop.log.LoopLogService?method=addLog('${exchangeProperty[logMessage]} - ${header.CamelHttpResponseCode} : ${header.CamelHttpResponseText}','INFO',${exchangeProperty[loopObject]})" />
</route>
</routes> \ No newline at end of file