X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fclamp%2Fclds%2Fclient%2Freq%2FSdcReq.java;h=640d3b0cdf520ae77166e5e394f9e4b3be34e5be;hb=a9d631c0dc2f9d3abfb595066283c4fcbd6b7d4f;hp=32846ed0150f1255871264e70dee8af96fe67d8a;hpb=0332719940cc8110f8fec62dd46cce3bd88e56aa;p=clamp.git diff --git a/src/main/java/org/onap/clamp/clds/client/req/SdcReq.java b/src/main/java/org/onap/clamp/clds/client/req/SdcReq.java index 32846ed0..640d3b0c 100644 --- a/src/main/java/org/onap/clamp/clds/client/req/SdcReq.java +++ b/src/main/java/org/onap/clamp/clds/client/req/SdcReq.java @@ -88,47 +88,12 @@ public class SdcReq { String updatedBlueprint = ""; Tca tca = prop.getType(Tca.class); if (tca.isFound()) { - updatedBlueprint = TcaRequestFormatter.updatedBlueprintWithConfiguration(refProp, prop, yamlvalue); - } + updatedBlueprint = TcaRequestFormatter.updatedBlueprintWithConfiguration(refProp, prop, yamlvalue); + } logger.info("value of blueprint:" + updatedBlueprint); return updatedBlueprint; } - private static String getUpdatedBlueprintWithConfiguration(RefProp refProp, ModelProperties prop, String yamlValue, - ObjectNode serviceConf) throws IOException { - String blueprint = ""; - Yaml yaml = new Yaml(); - // Serialiaze Yaml file - Map loadedYaml = (Map) yaml.load(yamlValue); - // Get node templates information from Yaml - Map nodeTemplates = loadedYaml.get("node_templates"); - logger.info("value of NodeTemplates:" + nodeTemplates); - // Get Tca Object information from node templates of Yaml - Map tcaObject = nodeTemplates.get("MTCA"); - logger.info("value of Tca:" + tcaObject); - // Get Properties Object information from tca of Yaml - Map propsObject = tcaObject.get("properties"); - logger.info("value of PropsObject:" + propsObject); - String deploymentJsonObject = propsObject.get("deployment_JSON"); - logger.info("value of deploymentJson:" + deploymentJsonObject); - - ObjectMapper mapper = new ObjectMapper(); - - ObjectNode deployJsonNode = (ObjectNode) mapper.readTree(deploymentJsonObject); - - // "policyName":"example_model06.ClosedLoop_FRWL_SIG_0538e6f2_8c1b_4656_9999_3501b3c59ad7_Tca_", - String policyNamePrefix = refProp.getStringValue("policy.ms.policyNamePrefix"); - String policyName = prop.getCurrentPolicyScopeAndFullPolicyName(policyNamePrefix); - serviceConf.put("policyName", policyName); - - deployJsonNode.set("configuration", serviceConf); - propsObject.put("deployment_JSON", deployJsonNode.toString()); - blueprint = yaml.dump(loadedYaml); - logger.info("value of updated Yaml File:" + blueprint); - - return blueprint; - } - public static String formatSdcLocationsReq(ModelProperties prop, String artifactName) { ObjectMapper objectMapper = new ObjectMapper(); Global global = prop.getGlobal(); @@ -207,7 +172,6 @@ public class SdcReq { String svcUrl = baseUrl + "/" + serviceUUID + "/resourceInstances/" + normalizedResourceInstanceName + "/artifacts"; urlList.add(svcUrl); - } } }