Update TCA config json send to Policy

Update the format of the TCA configuration send to Policy

Issue-ID: CLAMP-62
Change-Id: I53cbfcb1f8f8772856b645e8aec0db2a8a94d15e
Signed-off-by: xg353y <xg353y@intl.att.com>
diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/tca_properties.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/tca_properties.html
index 546909a..323891e 100644
--- a/src/main/resources/META-INF/resources/designer/partials/portfolios/tca_properties.html
+++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/tca_properties.html
@@ -191,8 +191,13 @@
 							<div class="col-sm-9" style="padding:0px;">
 								<select name="eventName" id="eventName" enableFilter="true"></select>
 							</div>
-						</div>            
-						
+						</div>
+						<div class="col-sm-8 form-group">
+							<label class="col-sm-3">Control Loop Schema Type</label>
+							<div class="col-sm-9" style="padding:0px;">
+								<select name="controlLoopSchemaType" id="controlLoopSchemaType" enableFilter="true"></select>
+							</div>
+						</div>
 						<div class="col-sm-8 form-group" style="display:none;">
 							<label class="col-sm-3"> Policy ID </label>
 							<div class="col-sm-9" style="padding:0px;">
@@ -202,7 +207,7 @@
 
 					</div>
 				</form>
-				
+
  				<div class="tcaBody row">
 					<div class="col-sm-5" style="padding:0px 5px; margin: 15px;">
 						<div class="panel panel-default" id="tcaTableHolder">
@@ -243,17 +248,11 @@
 									</div>
 								</div>
 								<div>
-									<label class="control-label">Control Loop Schema</label>
-									<div>
-										<select id="controlLoopSchema" name="controlLoopSchema"></select>
-									</div>
-								</div>
-								<div>
 									<label class="control-label">Closed Loop Event Status</label>
 									<div>
 										<select id="closedLoopEventStatus" name="closedLoopEventStatus"></select>
 									</div>
-								</div>                
+								</div>
 							</div>
 						</div>
 					</div>
@@ -298,17 +297,16 @@
       return $('#formId'+formIdNum+' #fieldPathM').find(':selected').text() + ' ' +
 				$('#formId'+formIdNum+' #operator').val() + ' ' +
 				$('#formId'+formIdNum+' #threshold').val() + ' ' +
-        $('#formId'+formIdNum+' #controlLoopSchema').val() + ' ' +
         $('#formId'+formIdNum+' #closedLoopEventStatus').val();
     };
 
 		loadPropertyWindow("tca");
-		
+
 		//load dropdown with policy options
  		if (typeof allPolicies !== "undefined"){
 	       	$.each(Object.keys(allPolicies), function(val, text) {
 	       		$('#tcaPol').append($('<option></option>').val(text).html(text));
-	        });  
+	        });
 		} else if (typeof elementMap !== "undefined"){
 			for (key in elementMap){
 				if (key.indexOf("Policy")>-1){
@@ -509,16 +507,15 @@
 						$('#formId'+count+' #fieldPathM').val(fieldPathMLabel2Value(str[0])).multiselect('refresh');
 						$('#formId'+count+' #operator').val(str[1]).multiselect('refresh');
 						$('#formId'+count+' #threshold').val(str[2]);
-            $('#formId'+count+' #controlLoopSchema').val(str[3]).multiselect('refresh');
-            $('#formId'+count+' #closedLoopEventStatus').val(str[4]).multiselect('refresh');
+            $('#formId'+count+' #closedLoopEventStatus').val(str[3]).multiselect('refresh');
 					}
-					
+
 					if ((!(readOnly||readMOnly)) && ($('#formId'+count + ' #deleteThresh').prop('disabled'))) {
 						$('#formId'+count + ' #deleteThresh').prop('disabled', false);
 					}
 				}
 			});
-			
+
 			$('#formId'+count+' #deleteThresh').on('click', function(){
 				$('#formId'+num+' .tcaErr').hide();
 				$('#formId'+count+ ' #properties_tab').invisible();
@@ -544,7 +541,6 @@
 					$('#formId'+count+' #fieldPathM').prop("selectedIndex", 0).multiselect('refresh');
 					$('#formId'+count+' #operator').prop("selectedIndex", 0).multiselect('refresh');
 					$('#formId'+count+' #threshold').val("");
-					$('#formId'+count+' #controlLoopSchema').prop("selectedIndex", 0).multiselect('refresh');
 					$('#formId'+count+' #closedLoopEventStatus').prop("selectedIndex", 0).multiselect('refresh');
 
 					if ($('#formId'+count + ' #deleteThresh').prop('disabled')) {
@@ -552,7 +548,7 @@
 					}
 				}
 			});
-			
+
 			$('#formId'+count+' #tname').on('change',function(){
 				$('#go_properties_tab'+count).text($('#formId'+count+' #tname').val())
 			});
diff --git a/src/main/resources/clds/clds-policy-config.properties b/src/main/resources/clds/clds-policy-config.properties
index fa2634b..a2bc1fa 100644
--- a/src/main/resources/clds/clds-policy-config.properties
+++ b/src/main/resources/clds/clds-policy-config.properties
@@ -21,9 +21,8 @@
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 ###
 # Configuration Settings for Policy Engine Components
-PDP_URL1=https://vm1.policy.simpledemo.openecomp.org:8081/pdp/ , testpdp, alpha123
-PDP_URL2=https://vm1.policy.simpledemo.openecomp.org:8081/pdp/ , testpdp, alpha456
-PAP_URL=https://vm1.policy.simpledemo.openecomp.org:8081/pap/ , testpap, alpha123
+PDP_URL1=https://vm1.policy.simpledemo.onap.org:8081/pdp/ , testpdp, alpha123
+PDP_URL2=https://vm1.policy.simpledemo.onap.org:8081/pdp/ , testpdp, alpha123
 NOTIFICATION_TYPE=websocket
 NOTIFICATION_UEB_SERVERS=localhost
 NOTIFICATION_TOPIC=
diff --git a/src/main/resources/clds/clds-reference.properties b/src/main/resources/clds/clds-reference.properties
index fd7af5e..94f6dd2 100644
--- a/src/main/resources/clds/clds-reference.properties
+++ b/src/main/resources/clds/clds-reference.properties
@@ -48,8 +48,9 @@
 # TCA MicroService Policy request build properties

 #

 tca.policyid.prefix=DCAE.Config_

-tca.template={"cdap-tca-hi-lo_policy": {"domain": "measurementsForVfScaling","metricsPerEventName": [{"eventName": "???","policyScope": "DCAE","policyName": "???","policyVersion": "v0.0.1","thresholds": []}]}}

-tca.thresholds.template={"closedLoopControlName": "???", "controlLoopSchema": "VM","version": "1.0.2","fieldPath": "?????", "thresholdValue": 0,"direction": "???","severity": "MAJOR", "closedLoopEventStatus": "???"}

+tca.policy.template={"service": "policy_tosca_tca", "version": "1.0.0", "location": "SampleServiceLocation", "configName": "SampleConfigName", "uuid": "test", "policyScope": "resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e", "templateVersion": "OpenSource.version.1", "policyName": "MicroServicevCPE", "description": "MicroService Policy", "priority": "1", "riskType": "SampleRiskType", "riskLevel": "1", "guard": "False","content":{}}

+tca.template= {"domain": "measurementsForVfScaling", "metricsPerEventName": [{"eventName": "???", "controlLoopSchemaType":"VNF","policyScope": "DCAE","policyName": "???","policyVersion": "v0.0.1","thresholds": []}]}

+tca.thresholds.template={"closedLoopControlName": "???", "version": "1.0.2","fieldPath": "?????", "thresholdValue": 0,"direction": "???","severity": "MAJOR", "closedLoopEventStatus": "???"}

 

 #

 #

@@ -60,24 +61,24 @@
 op.templateName=ClosedLoopvUSP

 op.operationTopic=APPC-CL

 op.notificationTopic=POLICY-CL-MGT

-op.controller=1610-vUSP

+op.controller=amsterdam

 op.policy.appc=APPC

 # by service: vSCP

 op.templateName.vSCP=ClosedLoopTemplate

 op.controller.vSCP=1607-f5fw

-op.eNodeB.templateName=CLeNodeB

+op.eNodeB.templateName=ClosedLoopControlName

 op.eNodeB.operationTopic=com.onap.sdnr.RanCLRequest-v00

 op.eNodeB.notificationTopic=com.onap-policy.IST-ENODEB-CL

-op.eNodeB.controller=ClosedLoop-eNodeB

+op.eNodeB.controller=amsterdam

 op.eNodeB.recipe={"eNodeBRecipes":[{"Actor":"AOTS","Recipe":"checkENodeBTicketHours","ParentPolicy":"","PPConditions":"","Retry":"0","TimeLimit":"120"},{"Actor":"AOTS","Recipe":"checkEquipmentStatus","ParentPolicy":"checkENodeBTicketHours","PPConditions":"Success","Retry":"0","TimeLimit":"120"},{"Actor":"AOTS","Recipe":"checkEimStatus","ParentPolicy":"checkEquipmentStatus","PPConditions":"Success","Retry":"0","TimeLimit":"120"},{"Actor":"AOTS","Recipe":"checkMaintenanceWindow","ParentPolicy":"checkEimStatus","PPConditions":"Success","Retry":"0","TimeLimit":"120"},{"Actor":"SDNR","Recipe":"Reset","ParentPolicy":"checkMaintenanceWindow","PPConditions":"Success","Retry":"","TimeLimit":""}]}

 op.eNodeB.timeWindow=35

 op.eNodeB.limit=2

 op.eNodeB.period=10s

 #

 # Sdc service properties

-sdc.catalog.url=http://sdc.api.simpledemo.openecomp.org:8080/sdc/v1/catalog/
-sdc.hostUrl=http://sdc.api.simpledemo.openecomp.org:8080
-sdc.serviceUrl=http://sdc.api.simpledemo.openecomp.org:8080/sdc/v1/catalog/services
+sdc.catalog.url=http://sdc.api.simpledemo.onap.org:8080/sdc/v1/catalog/
+sdc.hostUrl=http://sdc.api.simpledemo.onap.org:8080
+sdc.serviceUrl=http://sdc.api.simpledemo.onap.org:8080/sdc/v1/catalog/services
 sdc.serviceUsername=test

 sdc.servicePassword=123456

 sdc.artifactLabel=blueprintclampcockpit

@@ -99,8 +100,8 @@
 CLDS_SERVICE_CACHE_MAX_SECONDS=30

 

 #DCAE Inventory Url Properties

-DCAE_INVENTORY_URL = https://dcae.api.simpledemo.openecomp.org:8080
+DCAE_INVENTORY_URL = https://dcae.api.simpledemo.onap.org:8080
 

 #DCAE Dispatcher Url Properties

-DCAE_DISPATCHER_URL = https://dcae.api.simpledemo.openecomp.org:8443
+DCAE_DISPATCHER_URL = https://dcae.api.simpledemo.onap.org:8443
 

diff --git a/src/main/resources/clds/clds-users.json b/src/main/resources/clds/clds-users.json
index b569f9d..5909e8e 100644
--- a/src/main/resources/clds/clds-users.json
+++ b/src/main/resources/clds/clds-users.json
@@ -1,7 +1,20 @@
  [{
-    "user":"admin",
-    "password":"5f4dcc3b5aa765d61d8327deb882cf99",
-	"permissions": 
+	"user":"admin",
+	"password":"5f4dcc3b5aa765d61d8327deb882cf99",
+	"permissions":
+	            [
+	               "permission-type-cl|dev|read",
+	               "permission-type-cl|dev|update",
+	               "permission-type-cl-manage|dev|*",
+	               "permission-type-filter-vf|dev|*",
+	               "permission-type-template|dev|read",
+	               "permission-type-template|dev|update"
+	            ]
+	},
+	{
+	"user":"cs0008",
+	"password":"5f4dcc3b5aa765d61d8327deb882cf99",
+	"permissions":
 	            [
 	               "permission-type-cl|dev|read",
 	               "permission-type-cl|dev|update",
@@ -11,5 +24,4 @@
 	               "permission-type-template|dev|update"
 	            ]
 	}
-
 ]
\ No newline at end of file
diff --git a/src/main/resources/clds/globalClds.properties b/src/main/resources/clds/globalClds.properties
index d21afbc..c3d2706 100644
--- a/src/main/resources/clds/globalClds.properties
+++ b/src/main/resources/clds/globalClds.properties
@@ -11,14 +11,14 @@
 # 
 # http://www.apache.org/licenses/LICENSE-2.0
 # 
-# Unless required by applicable law or agreed to in writing, software 
-# distributed under the License is distributed on an "AS IS" BASIS, 
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-# See the License for the specific language governing permissions and 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
 # limitations under the License.
 # ============LICENSE_END============================================
 # ===================================================================
 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
 ###
 
-globalCldsProps ={"tca":{"tname":"New_Set","tcaInt":"1","tcaVio":"1","eventName":{"vCPEvGMUXPacketLoss":"vCPEvGMUXPacketLoss","vLoadBalancer":"vLoadBalancer","vFirewallBroadcastPackets":"vFirewallBroadcastPackets"},"fieldPathM":{"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated":"receivedBroadcastPacketsAccumulated","$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta":"receivedDiscardedPacketsDelta"},"operator":{">":"GREATER",">=":"GREATER_OR_EQUAL","=":"EQUAL","<=":"LESS_OR_EQUAL","<":"LESS"},"opsPolicy":{"POLICY_test_X":"POLICY_test_X","POLICY_test_Y":"POLICY_test_Y"},"controlLoopSchema":{"":"","VM":"VM","VNF":"VNF"},"closedLoopEventStatus":{"":"","ONSET":"ONSET","ABATED":"ABATED"}},"global":{"actionSet":{"vnfRecipe":"VNF", "enbRecipe":"eNodeB"},"location":{"SNDGCA64":"San Diego SAN3","ALPRGAED":"Alpharetta PDK1","LSLEILAA":"Lisle DPA3","MDTWNJC1":"FTL_C_location1","MDTWNJC2":"FTL_C_location2","MDTWNJ21":"FTL_L_location1","MDTWNJ22":"FTL_L_location2","RDM2WAGPLCP":"ISTFTL_location","RDM3":"RDM3WAGPLCP"}},"policy":{"pname":"0","timeout":345,"vnfRecipe":{"":"","restart":"Restart","rebuild":"Rebuild","migrate":"Migrate","healthCheck":"Health Check"},"enbRecipe":{"":"","reset":"Reset"},"maxRetries":"3","retryTimeLimit":180,"resource":{"vCTS":"vCTS","v3CDB":"v3CDB","vUDR":"vUDR","vCOM":"vCOM","vRAR":"vRAR","vLCS":"vLCS","vUDR-BE":"vUDR-BE","vDBE":"vDBE"},"parentPolicyConditions":{"Failure_Retries":"Failure: Max Retries Exceeded","Failure_Timeout":"Failure: Time Limit Exceeded","Failure_Guard":"Failure: Guard","Failure_Exception":"Failure: Exception","Failure":"Failure: Other","Success":"Success"}},"shared":{"byService":{"":{"vf":{"":""},"location":{"":""},"alarmCondition":{"":""}}},"byVf":{"":{"vfc":{"":""}}}}}
+globalCldsProps ={"tca":{"tname":"New_Set","tcaInt":"1","tcaVio":"1","eventName":{"vCPEvGMUXPacketLoss":"vCPEvGMUXPacketLoss","vLoadBalancer":"vLoadBalancer","vFirewallBroadcastPackets":"vFirewallBroadcastPackets"},"fieldPathM":{"$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated":"receivedBroadcastPacketsAccumulated","$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta":"receivedDiscardedPacketsDelta"},"operator":{">":"GREATER",">=":"GREATER_OR_EQUAL","=":"EQUAL","<=":"LESS_OR_EQUAL","<":"LESS"},"opsPolicy":{"POLICY_test_X":"POLICY_test_X","POLICY_test_Y":"POLICY_test_Y"},"controlLoopSchemaType":{"":"","VM":"VM","VNF":"VNF"},"closedLoopEventStatus":{"":"","ONSET":"ONSET","ABATED":"ABATED"}},"global":{"actionSet":{"vnfRecipe":"VNF", "enbRecipe":"eNodeB"},"location":{"SNDGCA64":"San Diego SAN3","ALPRGAED":"Alpharetta PDK1","LSLEILAA":"Lisle DPA3","MDTWNJC1":"FTL_C_location1","MDTWNJC2":"FTL_C_location2","MDTWNJ21":"FTL_L_location1","MDTWNJ22":"FTL_L_location2","RDM2WAGPLCP":"ISTFTL_location","RDM3":"RDM3WAGPLCP"}},"policy":{"pname":"0","timeout":345,"vnfRecipe":{"":"","restart":"Restart","rebuild":"Rebuild","migrate":"Migrate","healthCheck":"Health Check"},"enbRecipe":{"":"","reset":"Reset"},"maxRetries":"3","retryTimeLimit":180,"resource":{"vCTS":"vCTS","v3CDB":"v3CDB","vUDR":"vUDR","vCOM":"vCOM","vRAR":"vRAR","vLCS":"vLCS","vUDR-BE":"vUDR-BE","vDBE":"vDBE"},"parentPolicyConditions":{"Failure_Retries":"Failure: Max Retries Exceeded","Failure_Timeout":"Failure: Time Limit Exceeded","Failure_Guard":"Failure: Guard","Failure_Exception":"Failure: Exception","Failure":"Failure: Other","Success":"Success"}},"shared":{"byService":{"":{"vf":{"":""},"location":{"":""},"alarmCondition":{"":""}}},"byVf":{"":{"vfc":{"":""}}}}}