Rework the submit operation

Rework the logic to create/delete ms config policies.

Issue-ID: CLAMP-303
Change-Id: I317e262ab68280a7518a6e31e82e5fcb0a7f94ed
Signed-off-by: xg353y <xg353y@intl.att.com>
diff --git a/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js b/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js
index a71e6ca..90cdc0d 100644
--- a/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js
+++ b/src/main/resources/META-INF/resources/designer/scripts/CldsModelService.js
@@ -96,7 +96,7 @@
 		    var def = $q.defer();
 		    var sets = [];
 		    var svcAction = uiAction.toLowerCase();
-		    var svcUrl = "/restservices/clds/v2/loop/" + "action/" + svcAction + "/" + modelName;
+		    var svcUrl = "/restservices/clds/v2/loop/" + svcAction + "/" + modelName;
 
 			$http.put(svcUrl).success(
 				function(data) {
diff --git a/src/main/resources/application-noaaf.properties b/src/main/resources/application-noaaf.properties
index 632856e..f54cbe0 100644
--- a/src/main/resources/application-noaaf.properties
+++ b/src/main/resources/application-noaaf.properties
@@ -135,6 +135,9 @@
 #
 #
 # Configuration Settings for Policy Engine Components
+clamp.config.policy.url=http://localhost:8085/
+clamp.config.policy.userName=test
+clamp.config.policy.password=test
 clamp.config.policy.pdpUrl1=http://policy.api.simpledemo.onap.org:8081/pdp/ , testpdp, alpha123
 clamp.config.policy.pdpUrl2=http://policy.api.simpledemo.onap.org:8081/pdp/ , testpdp, alpha123
 clamp.config.policy.papUrl=http://policy.api.simpledemo.onap.org:8081/pap/ , testpap, alpha123
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties
index 91c02ef..5b47d32 100644
--- a/src/main/resources/application.properties
+++ b/src/main/resources/application.properties
@@ -150,6 +150,9 @@
 #
 #
 # Configuration Settings for Policy Engine Components
+clamp.config.policy.url=http://policy.api.simpledemo.onap.org:8081/pdp/
+clamp.config.policy.userName=test
+clamp.config.policy.password=test
 clamp.config.policy.pdpUrl1=http://policy.api.simpledemo.onap.org:8081/pdp/ , testpdp, alpha123
 clamp.config.policy.pdpUrl2=http://policy.api.simpledemo.onap.org:8081/pdp/ , testpdp, alpha123
 clamp.config.policy.papUrl=http://policy.api.simpledemo.onap.org:8081/pap/ , testpap, alpha123
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 c5828b2..f339d5d 100644
--- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml
+++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml
@@ -71,6 +71,24 @@
                 <to uri="bean:org.onap.clamp.operation.LoopOperation?method=unDeployLoop(${header.loopName})" />
             </route>
         </put>
+        <put uri="/v2/loop/submit/{loopName}">
+            <route>
+                <to uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
+                <to uri="bean:org.onap.clamp.operation.LoopOperation?method=submitMsPolicies(${header.loopName})" />
+                <!-- <to uri="bean:org.onap.clamp.operation.LoopOperation?method=submitOpPolicy(${header.loopName})" />-->
+                <!--<to uri="bean:org.onap.clamp.operation.LoopOperation?method=submitGuardPolicy(${header.loopName})" /> -->
+            </route>
+        </put>
+        <put uri="/v2/loop/delete/{loopName}"
+            outType="org.onap.clamp.loop.Loop"
+            produces="application/json">
+            <route>
+                <to uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','update')" />
+                <to uri="bean:org.onap.clamp.operation.LoopOperation?method=deleteMsPolicies(${header.loopName})" />
+                <to uri="bean:org.onap.clamp.operation.LoopOperation?method=deleteOpPolicy(${header.loopName})" />
+                <to uri="bean:org.onap.clamp.operation.LoopOperation?method=deleteGuardPolicy(${header.loopName})" />
+            </route>
+        </put>
     </rest>
 </rests>