Commit 92af4962 authored by Spiros Koulouzis's avatar Spiros Koulouzis

added deploy params to TOSCA

parent 21c571a1
......@@ -423,10 +423,8 @@ public class ProvisionService {
// Map<String, Object> kvMap = null;
// KeyPair userKey = new KeyPair();
// KeyPair deployerKey = new KeyPair();
// Map<String, Key> privateCloudKeys = new HashMap<>();
// Map<String, Key> publicCloudKeys = new HashMap<>();
PlanResponse plan = addCloudCredentialsOnTOSCAPlan(provisionRequest);
Map<String, Object> toscaPlan = plan.getKeyValue();
Map<String, Object> topologyTemplate = (Map<String, Object>) ((Map<String, Object>) toscaPlan.get("topology_template"));
......@@ -469,11 +467,11 @@ public class ProvisionService {
Map<String, Object> properties = (Map<String, Object>) vmList.get(i).get("properties");
properties.put("user_name", deployUser);
}
if (name.contains("_key")) {
for (String nodeName : nodeNames) {
Map<String, Object> keyOutput = TOSCAUtils.buildTOSCAOutput(nodeName, p.getValue());
outputs.put(name, keyOutput);
}
}
if (name.contains("_key")) {
for (String nodeName : nodeNames) {
Map<String, Object> keyOutput = TOSCAUtils.buildTOSCAOutput(nodeName, p.getValue());
outputs.put(name, keyOutput);
}
}
// switch (name) {
......@@ -536,12 +534,12 @@ public class ProvisionService {
}
topologyTemplate.put("outputs", outputs);
List<String> userKeyIds = null;
if (provisionRequest != null) {
userKeyIds = provisionRequest.getUserKeyPairIDs();
} else {
// userKeyIds = provisionResponse.getUserKeyPairIDs();
}
// List<String> userKeyIds = null;
// if (provisionRequest != null) {
// userKeyIds = provisionRequest.getUserKeyPairIDs();
// } else {
//// userKeyIds = provisionResponse.getUserKeyPairIDs();
// }
// if (saveUserKeys) {
// if (userKeyIds != null && !userKeyIds.isEmpty()) {
......@@ -592,7 +590,6 @@ public class ProvisionService {
// existingCloudKeyPairIDs = cloudKeyPairIDs;
// }
// provisionResponse.setCloudKeyPairIDs(existingCloudKeyPairIDs);
// provisionResponse.setDeployParameters(deployParameters);
// provisionResponse.setKvMap(kvMap);
provisionResponse.setKvMap(toscaPlan);
......
......@@ -29,10 +29,10 @@ public class TOSCAUtils {
public static List<Map<String, Object>> getVMsFromTopology(Map<String, Object> toscaPlan) {
List<String> vmNames = getVMsNodeNamesFromTopology(toscaPlan);
Map<String, Object> topologyTemplate = (Map<String, Object>) toscaPlan.get("topology_template");
Map<String, Object> nodeTemplates = (Map<String, Object>) ((Map<String, Object>) toscaPlan.get("topology_template")).get("node_templates");
List<Map<String, Object>> vmList = new ArrayList<>();
for (String vmName : vmNames) {
Map<String, Object> vm = (Map<String, Object>) topologyTemplate.get(vmName);
Map<String, Object> vm = (Map<String, Object>) nodeTemplates.get(vmName);
// Map<String, Object> properties = (Map<String, Object>) vm.get("properties");
vmList.add(vm);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment