aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/onap/clamp/clds/client/req/policy/OperationalPolicyYamlFormatter.java19
-rw-r--r--src/main/resources/clds/templates/globalProperties.json19
2 files changed, 18 insertions, 20 deletions
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 1fc36082..b9ed0c09 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<String, Policy> policyObjMap = new HashMap<>();
List<PolicyItem> policyItemList = orderParentFirst(policyChain.getPolicyItems());
@@ -196,7 +192,6 @@ public class OperationalPolicyYamlFormatter {
}
}
-
protected static Resource[] convertToResources(List<String> 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 252b41f6..775ca1d9 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": {