Commit e3ff8cf2 authored by Spiros Koulouzis's avatar Spiros Koulouzis

moved username to properties

parent afb637cc
......@@ -162,6 +162,10 @@ node_types:
type: string
required: true
default: "Ubuntu 18.04"
user_name:
type: string
required: true
default: "vm_user"
# outputs for this node
attributes:
private_ip:
......@@ -183,10 +187,6 @@ node_types:
type: string
required: false
description: the type of VM depending on the provider. e.g. XOSmall, t.medium etc. It has to match the mem_size, num_cores etc.
user_name:
type: string
required: true
default: "vm_user"
host_name:
type: string
required: true
......
......@@ -70,8 +70,6 @@ public class ToscaHelper {
Configuration.getDefaultApiClient().setBasePath(sureToscaBasePath);
Configuration.getDefaultApiClient().setConnectTimeout(1200000);
api = new DefaultApi(Configuration.getDefaultApiClient());
System.err.println("ConnectTimeout: " + api.getApiClient().getConnectTimeout());
this.objectMapper = new ObjectMapper(new YAMLFactory().disable(YAMLGenerator.Feature.WRITE_DOC_START_MARKER));
objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
......@@ -217,27 +215,6 @@ public class ToscaHelper {
return toscaTemplate;
}
// public NodeTemplateMap setProvisionerInterfaceInVMTopology(NodeTemplateMap vmTopologyMap, Map<String, Object> provisionInterface) throws ApiException {
// vmTopologyMap.getNodeTemplate().setInterfaces(provisionInterface);
// return vmTopologyMap;
// }
private Map<String, Object> getBestProvisionInterfaceDefinition(List<Map<String, Object>> definitions) {
for (Map<String, Object> def : definitions) {
if (def.containsKey("tosca.interfaces.ARTICONF.CloudsStorm")) {
return def;
}
}
return null;
}
private Map<String, Object> getProvisionInterfaceInstanceDefaultValues(Map<String, Object> definition, String operation) throws ApiException {
String type = definition.keySet().iterator().next();
String[] typeArray = type.split("\\.");
Map<String, Object> provisionInterface = api.getDefaultInterface(String.valueOf(id), type, typeArray[typeArray.length - 1], operation);
// provisionInterface.remove("")
return provisionInterface;
}
// public Map<String, Object> getProvisionInterface(Provisioner provisioner, String operation) throws ApiException {
// List<String> toscaInterfaceTypes = new ArrayList<>();
// toscaInterfaceTypes.add(provisioner.getToscaInterfaceType());
......@@ -251,6 +228,19 @@ public class ToscaHelper {
}
public NodeTemplateMap setProvisionerInterfaceInVMTopology(NodeTemplateMap vmTopologyMap, Map<String, Object> provisionerInterface) {
System.err.println(provisionerInterface);
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
public String getVMTopologyUser() throws ApiException {
List<NodeTemplateMap> vmTopologyTemplatesMap = getVMTopologyTemplates();
for (NodeTemplateMap nodeTemplateMap : vmTopologyTemplatesMap) {
List<NodeTemplateMap> vmTemplatesMap = getTemplateVMsForVMTopology(nodeTemplateMap);
for (NodeTemplateMap vmMap : vmTemplatesMap) {
Map<String, Object> att = vmMap.getNodeTemplate().getAttributes();
}
}
return "vm_user";
}
}
......@@ -16,7 +16,6 @@ import java.util.logging.Logger;
import nl.uva.sne.drip.api.NotFoundException;
import nl.uva.sne.drip.commons.utils.ToscaHelper;
import nl.uva.sne.drip.model.Message;
import nl.uva.sne.drip.model.NodeTemplate;
import nl.uva.sne.drip.model.NodeTemplateMap;
import nl.uva.sne.drip.model.tosca.Credential;
import nl.uva.sne.drip.model.tosca.ToscaTemplate;
......
......@@ -118,7 +118,7 @@ class CloudStormService {
CloudsStormTopTopology topTopology = new CloudsStormTopTopology();
String publicKeyPath = buildSSHKeyPair(tempInputDirPath);
topTopology.setPublicKeyPath(publicKeyPath);
topTopology.setUserName(getUserName());
topTopology.setUserName(helper.getVMTopologyUser());
Map<String, Object> subTopologiesAndVMs = getCloudsStormSubTopologiesAndVMs(tempInputDirPath);
List<CloudsStormSubTopology> cloudsStormSubTopology = (List<CloudsStormSubTopology>) subTopologiesAndVMs.get("cloud_storm_subtopologies");
......@@ -141,10 +141,6 @@ class CloudStormService {
return publicKeyPath;
}
private String getUserName() {
return "vm_user";
}
private Map<String, Object> getCloudsStormSubTopologiesAndVMs(String tempInputDirPath) throws ApiException, IOException, Exception {
List<NodeTemplateMap> vmTopologyTemplatesMap = helper.getVMTopologyTemplates();
List<CloudsStormSubTopology> cloudsStormSubTopologies = new ArrayList<>();
......
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