From 32eaf1e97f17a9d7a7b304fdc2b2be00c5830434 Mon Sep 17 00:00:00 2001 From: "Determe, Sebastien (sd378r)" Date: Mon, 5 Mar 2018 17:46:49 +0100 Subject: Remove globalClds.properties Remove the globalClds.properties and merge that to application.properties Issue-ID: CLAMP-136 Change-Id: I9c5bc8745b576ca8fad0cca3bff4c136329515d8 Signed-off-by: Determe, Sebastien (sd378r) --- .../resources/clds/templates/globalProperties.json | 105 +++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 src/test/resources/clds/templates/globalProperties.json (limited to 'src/test/resources/clds/templates/globalProperties.json') diff --git a/src/test/resources/clds/templates/globalProperties.json b/src/test/resources/clds/templates/globalProperties.json new file mode 100644 index 000000000..9ac9d9443 --- /dev/null +++ b/src/test/resources/clds/templates/globalProperties.json @@ -0,0 +1,105 @@ +{ + "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": { + "DC1": "Data Center 1", + "DC2": "Data Center 2", + "DC3": "Data Center 3" + } + }, + "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": { + "": "" + } + } + } + } +} -- cgit 1.2.3-korg From bf74fbfd181970d880803e4f8bc4f34a7a498f6e Mon Sep 17 00:00:00 2001 From: "Determe, Sebastien (sd378r)" Date: Tue, 24 Apr 2018 17:20:31 +0200 Subject: Remove eNodeB Remove eNodeB in the config files for UI and tests Issue-ID: CLAMP-153 Change-Id: I090449869e83220777387d58b37ebcd3d7dec101 Signed-off-by: Determe, Sebastien (sd378r) --- .../portfolios/PolicyWindow_properties.html | 9 ----- .../resources/clds/templates/globalProperties.json | 7 +--- .../resources/clds/templates/globalProperties.json | 7 +--- .../resources/clds/templates/op-eNodeB-recipe.json | 44 ---------------------- .../custom/modelBpmnProperties.json | 2 +- .../policy/modelBpmnProperties.json | 2 +- .../expected-result/sdc-properties-4cc5b45a.json | 7 +--- .../example/sdc/sdcResourceDetailsExample.json | 11 ------ src/test/resources/example/sdc/sdcVFResources.json | 28 +------------- 9 files changed, 6 insertions(+), 111 deletions(-) delete mode 100644 src/test/resources/clds/templates/op-eNodeB-recipe.json (limited to 'src/test/resources/clds/templates/globalProperties.json') diff --git a/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html b/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html index a0b8f4e7d..c905be3a2 100644 --- a/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html +++ b/src/main/resources/META-INF/resources/designer/partials/portfolios/PolicyWindow_properties.html @@ -837,15 +837,6 @@ label { }); } break; - } else if (asSel == "enbRecipe"){ - if (vf_Services["policy"][asSel]){ - $.each((vf_Services["policy"][asSel]), function(val, text) { - $('#recipe').append( - $('').val(val).html(text) - ); - }); - } - break; } }; }; diff --git a/src/main/resources/clds/templates/globalProperties.json b/src/main/resources/clds/templates/globalProperties.json index 9ac9d9443..c9bbbf72b 100644 --- a/src/main/resources/clds/templates/globalProperties.json +++ b/src/main/resources/clds/templates/globalProperties.json @@ -36,8 +36,7 @@ }, "global": { "actionSet": { - "vnfRecipe": "VNF", - "enbRecipe": "eNodeB" + "vnfRecipe": "VNF" }, "location": { "DC1": "Data Center 1", @@ -55,10 +54,6 @@ "migrate": "Migrate", "healthCheck": "Health Check" }, - "enbRecipe": { - "": "", - "reset": "Reset" - }, "maxRetries": "3", "retryTimeLimit": 180, "resource": { diff --git a/src/test/resources/clds/templates/globalProperties.json b/src/test/resources/clds/templates/globalProperties.json index 9ac9d9443..c9bbbf72b 100644 --- a/src/test/resources/clds/templates/globalProperties.json +++ b/src/test/resources/clds/templates/globalProperties.json @@ -36,8 +36,7 @@ }, "global": { "actionSet": { - "vnfRecipe": "VNF", - "enbRecipe": "eNodeB" + "vnfRecipe": "VNF" }, "location": { "DC1": "Data Center 1", @@ -55,10 +54,6 @@ "migrate": "Migrate", "healthCheck": "Health Check" }, - "enbRecipe": { - "": "", - "reset": "Reset" - }, "maxRetries": "3", "retryTimeLimit": 180, "resource": { diff --git a/src/test/resources/clds/templates/op-eNodeB-recipe.json b/src/test/resources/clds/templates/op-eNodeB-recipe.json deleted file mode 100644 index 7098987a2..000000000 --- a/src/test/resources/clds/templates/op-eNodeB-recipe.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "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": "" - } - ] -} diff --git a/src/test/resources/example/model-properties/custom/modelBpmnProperties.json b/src/test/resources/example/model-properties/custom/modelBpmnProperties.json index fc2f1fd99..740edeeab 100644 --- a/src/test/resources/example/model-properties/custom/modelBpmnProperties.json +++ b/src/test/resources/example/model-properties/custom/modelBpmnProperties.json @@ -21,7 +21,7 @@ "name": "actionSet", "value": [ - "enbRecipe" + "vnfRecipe" ] }, diff --git a/src/test/resources/example/model-properties/policy/modelBpmnProperties.json b/src/test/resources/example/model-properties/policy/modelBpmnProperties.json index 99f67b62e..5c2214e84 100644 --- a/src/test/resources/example/model-properties/policy/modelBpmnProperties.json +++ b/src/test/resources/example/model-properties/policy/modelBpmnProperties.json @@ -21,7 +21,7 @@ "name": "actionSet", "value": [ - "enbRecipe" + "vnfRecipe" ] }, diff --git a/src/test/resources/example/sdc/expected-result/sdc-properties-4cc5b45a.json b/src/test/resources/example/sdc/expected-result/sdc-properties-4cc5b45a.json index 8c5f39d8d..5e0ba72ab 100644 --- a/src/test/resources/example/sdc/expected-result/sdc-properties-4cc5b45a.json +++ b/src/test/resources/example/sdc/expected-result/sdc-properties-4cc5b45a.json @@ -36,8 +36,7 @@ }, "global": { "actionSet": { - "vnfRecipe": "VNF", - "enbRecipe": "eNodeB" + "vnfRecipe": "VNF" }, "location": { "DC1": "Data Center 1", @@ -55,10 +54,6 @@ "migrate": "Migrate", "healthCheck": "Health Check" }, - "enbRecipe": { - "": "", - "reset": "Reset" - }, "maxRetries": "3", "retryTimeLimit": 180, "resource": { diff --git a/src/test/resources/example/sdc/sdcResourceDetailsExample.json b/src/test/resources/example/sdc/sdcResourceDetailsExample.json index 6087d020f..3e904b107 100644 --- a/src/test/resources/example/sdc/sdcResourceDetailsExample.json +++ b/src/test/resources/example/sdc/sdcResourceDetailsExample.json @@ -108,17 +108,6 @@ "artifactVersion": "1", "artifactLabel": "heatartifact2", "artifactGroupType": "DEPLOYMENT" - }, - { - "artifactName": "eNodeB_Thresholds.csv", - "artifactType": "OTHER", - "artifactURL": "/sdc/v1/catalog/resources/84855843-5247-4e97-a2bd-5395a510253b/artifacts/d57ac7ec-f3c3-4793-983a-c75ac3a43153", - "artifactDescription": "kpis with nfNamingCode", - "artifactChecksum": "YTc1MDU0ZDFhODUwMGM5YmIwM2FmMWUzMmRiY2NlMGI=", - "artifactUUID": "d57ac7ec-f3c3-4793-983a-c75ac3a43153", - "artifactVersion": "1", - "artifactLabel": "kpis", - "artifactGroupType": "DEPLOYMENT" } ], diff --git a/src/test/resources/example/sdc/sdcVFResources.json b/src/test/resources/example/sdc/sdcVFResources.json index 62c58bee6..7bf99bb45 100644 --- a/src/test/resources/example/sdc/sdcVFResources.json +++ b/src/test/resources/example/sdc/sdcVFResources.json @@ -622,20 +622,7 @@ "lifecycleState": "READY_FOR_CERTIFICATION", "lastUpdaterUserId": "rx827p" }, - - { - "uuid": "e01dfc8f-2529-423b-9765-08b57df6ba51", - "invariantUUID": "6c7aaec2-59eb-41d9-8681-b7f976ab668d", - "name": "eNodeB-vf", - "version": "1.1", - "toscaModelURL": "/sdc/v1/catalog/resources/e01dfc8f-2529-423b-9765-08b57df6ba51/toscaModel", - "category": "Application L4+", - "subCategory": "Application Server", - "resourceType": "VF", - "lifecycleState": "CERTIFICATION_IN_PROGRESS", - "lastUpdaterUserId": "rx827p" - }, - + { "uuid": "d26e8473-b1c9-4751-bf7c-be0e10ba71ac", "invariantUUID": "e06a2a94-5ff9-4ab7-879f-c2d5cfaef1ca", @@ -1481,19 +1468,6 @@ "lastUpdaterUserId": "sa997j" }, - { - "uuid": "e01dfc8f-2529-423b-9765-08b57df6ba51", - "invariantUUID": "6c7aaec2-59eb-41d9-8681-b7f976ab668d", - "name": "eNodeB-vf", - "version": "2.0", - "toscaModelURL": "/sdc/v1/catalog/resources/e01dfc8f-2529-423b-9765-08b57df6ba51/toscaModel", - "category": "Application L4+", - "subCategory": "Application Server", - "resourceType": "VF", - "lifecycleState": "CERTIFIED", - "lastUpdaterUserId": "af3193" - }, - { "uuid": "1cad2e90-0259-498f-884d-7bbe5a156fb2", "invariantUUID": "76b01019-a533-4c31-871d-6275924c7543", -- cgit 1.2.3-korg From aa8d13e4fb8ea099c85969de91eff2d89190c366 Mon Sep 17 00:00:00 2001 From: "Determe, Sebastien (sd378r)" Date: Mon, 14 May 2018 17:35:42 +0200 Subject: Config Changes Changes done to the Clamp Config file globalProperties.json for the operational policies Issue-ID: CLAMP-153 Change-Id: Id512fcdab0687495cbfb741097fc19dfc5545093 Signed-off-by: Determe, Sebastien (sd378r) --- src/main/resources/clds/templates/globalProperties.json | 11 ++++++----- src/test/resources/clds/templates/globalProperties.json | 11 ++++++----- .../example/sdc/expected-result/sdc-properties-4cc5b45a.json | 11 ++++++----- 3 files changed, 18 insertions(+), 15 deletions(-) (limited to 'src/test/resources/clds/templates/globalProperties.json') diff --git a/src/main/resources/clds/templates/globalProperties.json b/src/main/resources/clds/templates/globalProperties.json index c9bbbf72b..062304280 100644 --- a/src/main/resources/clds/templates/globalProperties.json +++ b/src/main/resources/clds/templates/globalProperties.json @@ -4,13 +4,12 @@ "tcaInt": "1", "tcaVio": "1", "eventName": { - "vCPEvGMUXPacketLoss": "vCPEvGMUXPacketLoss", "vLoadBalancer": "vLoadBalancer", - "vFirewallBroadcastPackets": "vFirewallBroadcastPackets" + "vFirewallBroadcastPackets": "vFirewallBroadcastPackets", + "Measurement_vGMUX":"Measurement_vGMUX" }, "fieldPathM": { - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated": "receivedBroadcastPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta": "receivedDiscardedPacketsDelta" + "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value": "Packet-loss-rate" }, "operator": { ">": "GREATER", @@ -52,7 +51,9 @@ "restart": "Restart", "rebuild": "Rebuild", "migrate": "Migrate", - "healthCheck": "Health Check" + "healthCheck": "Health Check", + "modifyConfig": "ModifyConfig", + "vfModuleCreate":"VF Module Create" }, "maxRetries": "3", "retryTimeLimit": 180, diff --git a/src/test/resources/clds/templates/globalProperties.json b/src/test/resources/clds/templates/globalProperties.json index c9bbbf72b..062304280 100644 --- a/src/test/resources/clds/templates/globalProperties.json +++ b/src/test/resources/clds/templates/globalProperties.json @@ -4,13 +4,12 @@ "tcaInt": "1", "tcaVio": "1", "eventName": { - "vCPEvGMUXPacketLoss": "vCPEvGMUXPacketLoss", "vLoadBalancer": "vLoadBalancer", - "vFirewallBroadcastPackets": "vFirewallBroadcastPackets" + "vFirewallBroadcastPackets": "vFirewallBroadcastPackets", + "Measurement_vGMUX":"Measurement_vGMUX" }, "fieldPathM": { - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated": "receivedBroadcastPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta": "receivedDiscardedPacketsDelta" + "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value": "Packet-loss-rate" }, "operator": { ">": "GREATER", @@ -52,7 +51,9 @@ "restart": "Restart", "rebuild": "Rebuild", "migrate": "Migrate", - "healthCheck": "Health Check" + "healthCheck": "Health Check", + "modifyConfig": "ModifyConfig", + "vfModuleCreate":"VF Module Create" }, "maxRetries": "3", "retryTimeLimit": 180, diff --git a/src/test/resources/example/sdc/expected-result/sdc-properties-4cc5b45a.json b/src/test/resources/example/sdc/expected-result/sdc-properties-4cc5b45a.json index 5e0ba72ab..f1f67fe1b 100644 --- a/src/test/resources/example/sdc/expected-result/sdc-properties-4cc5b45a.json +++ b/src/test/resources/example/sdc/expected-result/sdc-properties-4cc5b45a.json @@ -4,13 +4,12 @@ "tcaInt": "1", "tcaVio": "1", "eventName": { - "vCPEvGMUXPacketLoss": "vCPEvGMUXPacketLoss", "vLoadBalancer": "vLoadBalancer", - "vFirewallBroadcastPackets": "vFirewallBroadcastPackets" + "vFirewallBroadcastPackets": "vFirewallBroadcastPackets", + "Measurement_vGMUX":"Measurement_vGMUX" }, "fieldPathM": { - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedBroadcastPacketsAccumulated": "receivedBroadcastPacketsAccumulated", - "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedDiscardedPacketsDelta": "receivedDiscardedPacketsDelta" + "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value": "Packet-loss-rate" }, "operator": { ">": "GREATER", @@ -52,7 +51,9 @@ "restart": "Restart", "rebuild": "Rebuild", "migrate": "Migrate", - "healthCheck": "Health Check" + "healthCheck": "Health Check", + "modifyConfig": "ModifyConfig", + "vfModuleCreate":"VF Module Create" }, "maxRetries": "3", "retryTimeLimit": 180, -- cgit 1.2.3-korg From c4912070e9c004b2a6eb3753b7fae9993c057e2d Mon Sep 17 00:00:00 2001 From: "Determe, Sebastien (sd378r)" Date: Wed, 30 May 2018 18:07:19 +0200 Subject: Add measure Add measure for the TCA policy window Issue-ID: CLAMP-153 Change-Id: Ie035de0fbd5bc24f559696f463183bf1fe68aa02 Signed-off-by: Determe, Sebastien (sd378r) --- src/main/resources/clds/templates/globalProperties.json | 3 ++- src/test/resources/clds/templates/globalProperties.json | 3 ++- .../resources/example/sdc/expected-result/sdc-properties-4cc5b45a.json | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/test/resources/clds/templates/globalProperties.json') diff --git a/src/main/resources/clds/templates/globalProperties.json b/src/main/resources/clds/templates/globalProperties.json index 062304280..e677abe9f 100644 --- a/src/main/resources/clds/templates/globalProperties.json +++ b/src/main/resources/clds/templates/globalProperties.json @@ -9,7 +9,8 @@ "Measurement_vGMUX":"Measurement_vGMUX" }, "fieldPathM": { - "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value": "Packet-loss-rate" + "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value": "Packet-loss-rate", + "$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta":"receivedTotalPacketsDelta" }, "operator": { ">": "GREATER", diff --git a/src/test/resources/clds/templates/globalProperties.json b/src/test/resources/clds/templates/globalProperties.json index 062304280..e677abe9f 100644 --- a/src/test/resources/clds/templates/globalProperties.json +++ b/src/test/resources/clds/templates/globalProperties.json @@ -9,7 +9,8 @@ "Measurement_vGMUX":"Measurement_vGMUX" }, "fieldPathM": { - "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value": "Packet-loss-rate" + "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value": "Packet-loss-rate", + "$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta":"receivedTotalPacketsDelta" }, "operator": { ">": "GREATER", diff --git a/src/test/resources/example/sdc/expected-result/sdc-properties-4cc5b45a.json b/src/test/resources/example/sdc/expected-result/sdc-properties-4cc5b45a.json index f1f67fe1b..c695ae00c 100644 --- a/src/test/resources/example/sdc/expected-result/sdc-properties-4cc5b45a.json +++ b/src/test/resources/example/sdc/expected-result/sdc-properties-4cc5b45a.json @@ -9,7 +9,8 @@ "Measurement_vGMUX":"Measurement_vGMUX" }, "fieldPathM": { - "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value": "Packet-loss-rate" + "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value": "Packet-loss-rate", + "$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta":"receivedTotalPacketsDelta" }, "operator": { ">": "GREATER", -- cgit 1.2.3-korg From 7253c2b707c1ac985fee1f6ed7ab45757a67b797 Mon Sep 17 00:00:00 2001 From: sebdet Date: Thu, 1 Nov 2018 23:50:04 +0100 Subject: Fix Policy Yaml Fix Policy Yaml generation, remove service and resource section + update the actor/recipe Issue-ID: CLAMP-243 Change-Id: Ia1adad6e653e7e85576858f2971f60f7903bfae2 Signed-off-by: sebdet --- .../req/policy/OperationalPolicyYamlFormatter.java | 19 +++++++------------ .../resources/clds/templates/globalProperties.json | 19 +++++++++++-------- .../resources/clds/templates/globalProperties.json | 18 ++++++++++-------- .../operational-policy/yaml-policy-chain-1.yaml | 13 ++----------- .../operational-policy/yaml-policy-chain-2.yaml | 13 ++----------- .../sdc/expected-result/sdc-properties-4cc5b45a.json | 18 ++++++++++-------- .../sdc/expected-result/sdc-properties-global.json | 18 ++++++++++-------- 7 files changed, 52 insertions(+), 66 deletions(-) (limited to 'src/test/resources/clds/templates/globalProperties.json') diff --git a/src/main/java/org/onap/clamp/clds/client/req/policy/OperationalPolicyYamlFormatter.java b/src/main/java/org/onap/clamp/clds/client/req/policy/OperationalPolicyYamlFormatter.java index 1fc360820..b9ed0c095 100644 --- a/src/main/java/org/onap/clamp/clds/client/req/policy/OperationalPolicyYamlFormatter.java +++ b/src/main/java/org/onap/clamp/clds/client/req/policy/OperationalPolicyYamlFormatter.java @@ -57,6 +57,7 @@ public class OperationalPolicyYamlFormatter { protected OperationalPolicyYamlFormatter() { } + /** * Format Operational OpenLoop Policy yaml. * @@ -67,8 +68,8 @@ public class OperationalPolicyYamlFormatter { * @throws BuilderException * @throws UnsupportedEncodingException */ - public static String formatOpenLoopYaml(ModelProperties prop, String modelElementId, - PolicyChain policyChain) throws BuilderException, UnsupportedEncodingException { + public static String formatOpenLoopYaml(ModelProperties prop, String modelElementId, PolicyChain policyChain) + throws BuilderException, UnsupportedEncodingException { // get property objects Global global = prop.getGlobal(); prop.setCurrentModelElementId(modelElementId); @@ -86,20 +87,15 @@ public class OperationalPolicyYamlFormatter { return URLEncoder.encode(results.getSpecification(), "UTF-8"); } - public static String formatYaml(ModelProperties prop, String modelElementId, - PolicyChain policyChain) throws BuilderException, UnsupportedEncodingException { + public static String formatYaml(ModelProperties prop, String modelElementId, PolicyChain policyChain) + throws BuilderException, UnsupportedEncodingException { // get property objects - Global global = prop.getGlobal(); prop.setCurrentModelElementId(modelElementId); prop.setPolicyUniqueId(policyChain.getPolicyId()); - // convert values to SDC objects - Service service = new Service(global.getService()); - Resource[] vfResources = convertToResources(global.getResourceVf(), ResourceType.VF); - Resource[] vfcResources = convertToResources(global.getResourceVfc(), ResourceType.VFC); + // create builder ControlLoopPolicyBuilder builder = ControlLoopPolicyBuilder.Factory.buildControlLoop(prop.getControlName(), - policyChain.getTimeout(), service, vfResources); - builder.addResource(vfcResources); + policyChain.getTimeout()); // process each policy Map policyObjMap = new HashMap<>(); List policyItemList = orderParentFirst(policyChain.getPolicyItems()); @@ -196,7 +192,6 @@ public class OperationalPolicyYamlFormatter { } } - protected static Resource[] convertToResources(List stringList, ResourceType resourceType) { if (stringList == null || stringList.isEmpty()) { return new Resource[0]; diff --git a/src/main/resources/clds/templates/globalProperties.json b/src/main/resources/clds/templates/globalProperties.json index 252b41f66..775ca1d92 100644 --- a/src/main/resources/clds/templates/globalProperties.json +++ b/src/main/resources/clds/templates/globalProperties.json @@ -50,17 +50,20 @@ "actor": { "APPC":"APPC", "SO": "SO", - "VFC": "VFC" + "VFC": "VFC", + "SDNC":"SDNC", + "SDNR":"SDNR" }, "vnfRecipe": { "": "", - "restart": "Restart", - "rebuild": "Rebuild", - "migrate": "Migrate", - "healthCheck": "Health Check", - "modifyConfig": "ModifyConfig", - "vfModuleCreate":"VF Module Create", - "scaleOut":"Scale Out" + "Restart": "Restart", + "Rebuild": "Rebuild", + "Migrate": "Migrate", + "HealthCheck": "Health Check", + "ModifyConfig": "Modify Config", + "VF Module Create":"VF Module Create", + "VF Module Delete":"VF Module Delete", + "Reroute":"Reroute" }, "maxRetries": "3", "recipeLevel": { diff --git a/src/test/resources/clds/templates/globalProperties.json b/src/test/resources/clds/templates/globalProperties.json index e677abe9f..067063ea2 100644 --- a/src/test/resources/clds/templates/globalProperties.json +++ b/src/test/resources/clds/templates/globalProperties.json @@ -9,8 +9,8 @@ "Measurement_vGMUX":"Measurement_vGMUX" }, "fieldPathM": { - "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value": "Packet-loss-rate", - "$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta":"receivedTotalPacketsDelta" + "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value": "packetLossRate", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta":"receivedTotalPacketsDelta" }, "operator": { ">": "GREATER", @@ -49,12 +49,14 @@ "timeout": 345, "vnfRecipe": { "": "", - "restart": "Restart", - "rebuild": "Rebuild", - "migrate": "Migrate", - "healthCheck": "Health Check", - "modifyConfig": "ModifyConfig", - "vfModuleCreate":"VF Module Create" + "Restart": "Restart", + "Rebuild": "Rebuild", + "Migrate": "Migrate", + "HealthCheck": "Health Check", + "ModifyConfig": "Modify Config", + "VF Module Create":"VF Module Create", + "VF Module Delete":"VF Module Delete", + "Reroute":"Reroute" }, "maxRetries": "3", "retryTimeLimit": 180, diff --git a/src/test/resources/example/operational-policy/yaml-policy-chain-1.yaml b/src/test/resources/example/operational-policy/yaml-policy-chain-1.yaml index 3d0252a00..19ee585b9 100644 --- a/src/test/resources/example/operational-policy/yaml-policy-chain-1.yaml +++ b/src/test/resources/example/operational-policy/yaml-policy-chain-1.yaml @@ -1,17 +1,8 @@ controlLoop: abatement: false controlLoopName: controlNameTest - resources: - - resourceInvariantUUID: null - resourceName: 6c7aaec2-59eb-41d9-8681-b7f976ab668d - resourceType: VF - resourceUUID: null - resourceVersion: null - services: - - serviceInvariantUUID: null - serviceName: 0f983e18-4603-4bb4-a98c-e29691fb16a1 - serviceUUID: null - serviceVersion: null + resources: null + services: null timeout: 500 trigger_policy: version: 2.0.0 diff --git a/src/test/resources/example/operational-policy/yaml-policy-chain-2.yaml b/src/test/resources/example/operational-policy/yaml-policy-chain-2.yaml index 3d0252a00..19ee585b9 100644 --- a/src/test/resources/example/operational-policy/yaml-policy-chain-2.yaml +++ b/src/test/resources/example/operational-policy/yaml-policy-chain-2.yaml @@ -1,17 +1,8 @@ controlLoop: abatement: false controlLoopName: controlNameTest - resources: - - resourceInvariantUUID: null - resourceName: 6c7aaec2-59eb-41d9-8681-b7f976ab668d - resourceType: VF - resourceUUID: null - resourceVersion: null - services: - - serviceInvariantUUID: null - serviceName: 0f983e18-4603-4bb4-a98c-e29691fb16a1 - serviceUUID: null - serviceVersion: null + resources: null + services: null timeout: 500 trigger_policy: version: 2.0.0 diff --git a/src/test/resources/example/sdc/expected-result/sdc-properties-4cc5b45a.json b/src/test/resources/example/sdc/expected-result/sdc-properties-4cc5b45a.json index c695ae00c..26454c319 100644 --- a/src/test/resources/example/sdc/expected-result/sdc-properties-4cc5b45a.json +++ b/src/test/resources/example/sdc/expected-result/sdc-properties-4cc5b45a.json @@ -9,8 +9,8 @@ "Measurement_vGMUX":"Measurement_vGMUX" }, "fieldPathM": { - "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value": "Packet-loss-rate", - "$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta":"receivedTotalPacketsDelta" + "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value": "packetLossRate", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta":"receivedTotalPacketsDelta" }, "operator": { ">": "GREATER", @@ -49,12 +49,14 @@ "timeout": 345, "vnfRecipe": { "": "", - "restart": "Restart", - "rebuild": "Rebuild", - "migrate": "Migrate", - "healthCheck": "Health Check", - "modifyConfig": "ModifyConfig", - "vfModuleCreate":"VF Module Create" + "Restart": "Restart", + "Rebuild": "Rebuild", + "Migrate": "Migrate", + "HealthCheck": "Health Check", + "ModifyConfig": "Modify Config", + "VF Module Create":"VF Module Create", + "VF Module Delete":"VF Module Delete", + "Reroute":"Reroute" }, "maxRetries": "3", "retryTimeLimit": 180, diff --git a/src/test/resources/example/sdc/expected-result/sdc-properties-global.json b/src/test/resources/example/sdc/expected-result/sdc-properties-global.json index f81784d77..be46dbca7 100644 --- a/src/test/resources/example/sdc/expected-result/sdc-properties-global.json +++ b/src/test/resources/example/sdc/expected-result/sdc-properties-global.json @@ -9,8 +9,8 @@ "Measurement_vGMUX": "Measurement_vGMUX" }, "fieldPathM": { - "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value": "Packet-loss-rate", - "$.event.measurementsForVfScalingFields.vNicUsageArray[*].receivedTotalPacketsDelta": "receivedTotalPacketsDelta" + "$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value": "packetLossRate", + "$.event.measurementsForVfScalingFields.vNicPerformanceArray[*].receivedTotalPacketsDelta": "receivedTotalPacketsDelta" }, "operator": { ">": "GREATER", @@ -49,12 +49,14 @@ "timeout": 345, "vnfRecipe": { "": "", - "restart": "Restart", - "rebuild": "Rebuild", - "migrate": "Migrate", - "healthCheck": "Health Check", - "modifyConfig": "ModifyConfig", - "vfModuleCreate": "VF Module Create" + "Restart": "Restart", + "Rebuild": "Rebuild", + "Migrate": "Migrate", + "HealthCheck": "Health Check", + "ModifyConfig": "Modify Config", + "VF Module Create":"VF Module Create", + "VF Module Delete":"VF Module Delete", + "Reroute":"Reroute" }, "maxRetries": "3", "retryTimeLimit": 180, -- cgit 1.2.3-korg