From 23a9fcc45932f062053beed77ce6a4763a28e5cd Mon Sep 17 00:00:00 2001 From: aleemraja Date: Wed, 16 Sep 2020 20:47:08 +0530 Subject: Enhancement to SO macro flow support - Added skip_post_instantiation_configuration as Vnf Level Params - Decision to set k8s-rb-profile name as default or not Issue-ID: EXTAPI-513 Signed-off-by: aleemraja Change-Id: I6bb9786660f6760c19669132e2c254e7f9b23323 --- .../java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessor.java | 5 ++++- .../org/onap/nbi/apis/serviceorder/workflow/PostSoProcessor.java | 7 +++++-- .../org/onap/nbi/apis/servicecatalog/ToscaInfosProcessorTest.java | 2 ++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessor.java b/src/main/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessor.java index 67f157e..1c04581 100644 --- a/src/main/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessor.java +++ b/src/main/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessor.java @@ -61,7 +61,7 @@ public class ToscaInfosProcessor { private Set vnfInstanceParams = new HashSet(Arrays.asList("onap_private_net_id", "onap_private_subnet_id", "pub_key", "sec_group", "install_script_version", "demo_artifacts_version", - "cloud_env", "public_net_id", "aic-cloud-region", "image_name", "flavor_name")); + "cloud_env", "public_net_id", "aic-cloud-region", "image_name", "flavor_name", "skip_post_instantiation_configuration")); final ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); // jackson databind @@ -290,6 +290,9 @@ public class ToscaInfosProcessor { GetInput getInput = (GetInput) property.getValue(); listOfVFLevelInputs.put(getInput.getInputName(), getInput.result()); listOfVFLevelInputs.remove(property.getName()); + } else if(property.getName().equals("skip_post_instantiation_configuration")) { + //Add skip_post_instantiation_configuration as vf Level Inputs + listOfVFLevelInputs.put(property.getName(), property.getValue()); } } diff --git a/src/main/java/org/onap/nbi/apis/serviceorder/workflow/PostSoProcessor.java b/src/main/java/org/onap/nbi/apis/serviceorder/workflow/PostSoProcessor.java index c356bdd..0cafcde 100644 --- a/src/main/java/org/onap/nbi/apis/serviceorder/workflow/PostSoProcessor.java +++ b/src/main/java/org/onap/nbi/apis/serviceorder/workflow/PostSoProcessor.java @@ -288,7 +288,9 @@ public class PostSoProcessor { instanceSpecification.putAll(vnfInstanceParams); vnfInstanceParam.add(instanceSpecification); } else { - vnfInstanceParams.put("k8s-rb-profile-name", k8sRbProfileName); + //if skip_post_instantiation_configuration is true then add k8s-rb-profile-name + if(instanceSpecification.get("skip_post_instantiation_configuration").equals(true)) + vnfInstanceParams.put("k8s-rb-profile-name", k8sRbProfileName); vnfInstanceParam.add(vnfInstanceParams); } @@ -337,7 +339,8 @@ public class PostSoProcessor { } else { Map instanceParam = new HashMap<>(); - instanceParam.put("k8s-rb-profile-name", k8sRbProfileName); + if(instanceSpecification.get("skip_post_instantiation_configuration").equals(true)) + instanceParam.put("k8s-rb-profile-name", k8sRbProfileName); vfInstanceParam.add(instanceParam); } diff --git a/src/test/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessorTest.java b/src/test/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessorTest.java index fe348de..e0a3f37 100644 --- a/src/test/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessorTest.java +++ b/src/test/java/org/onap/nbi/apis/servicecatalog/ToscaInfosProcessorTest.java @@ -356,6 +356,7 @@ public class ToscaInfosProcessorTest { "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC/EnxIi7fcHMEi9VPtCGCOpQYblj9r0M/CaD5U15Cb5qHzcHiPtJpVsDMlPGzN9VHxWZG6FqQv1s6oE+PmG1xeahhb+ofrY6s8zvlUCcWGIo/bPexzb2ErvkGyd+1tQo9oLrxNdUG0xeWUX3oFkiw3RBRyxf9n4E5ajZr4cEFQ0sqJkslj87XViw/h555ydIYTY5cPNmIlsIXTObC/2z3muVWYUzaaZE8omfYJE442+UhYLHgb7Cl1JMk/SNu/r+bLrsXeBSPB+/bxVKqjpd659AQ7GRNXvBrgfq6EKNiVjrI76AbpeTM2D/LXbENuUUkvJBWptSd0gPAGkEyc9w2n"); instanceSpecificationTestData.put("public_net_id", "60dc8a1c-86b8-4cc4-b5c8-9b0272113c1f0f1c389d-e9db-4c14-b3a2-11dca2d104ed"); + instanceSpecificationTestData.put("skip_post_instantiation_configuration", true); // Resources to put in response as resourceSpecification response.put("resourceSpecification", resources); @@ -406,6 +407,7 @@ public class ToscaInfosProcessorTest { Map instanceSpecificationTestData = new LinkedHashMap<>(); instanceSpecificationTestData.put("vfw_cnf_13080_dummy_vf_2", "xyz"); instanceSpecificationTestData.put("vfw_cnf_13080_dummy_vf_1", "abc"); + instanceSpecificationTestData.put("skip_post_instantiation_configuration", true); // serviceParams Test Data Map serviceParamsTestData = new LinkedHashMap<>(); -- cgit 1.2.3-korg