Commit af541c99 authored by Spiros Koulouzis's avatar Spiros Koulouzis

added missing properties

parent 8da728d5
...@@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; ...@@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import javax.validation.Valid; import javax.validation.Valid;
...@@ -16,10 +17,46 @@ import javax.validation.Valid; ...@@ -16,10 +17,46 @@ import javax.validation.Valid;
public class CloudsStormVMs { public class CloudsStormVMs {
/**
* @return the extraInfo
*/
public Map<String, Object> getExtraInfo() {
return extraInfo;
}
/**
* @param extraInfo the extraInfo to set
*/
public void setExtraInfo(Map<String, Object> extraInfo) {
this.extraInfo = extraInfo;
}
/**
* @return the sEngineClass
*/
public String getsEngineClass() {
return sEngineClass;
}
@JsonProperty("extraInfo")
@Valid
private Map<String, Object> extraInfo = null;
/**
* @param sEngineClass the sEngineClass to set
*/
public void setsEngineClass(String sEngineClass) {
this.sEngineClass = sEngineClass;
}
@JsonProperty("VMs") @JsonProperty("VMs")
@Valid @Valid
private List<CloudsStormVM> vms = null; private List<CloudsStormVM> vms = null;
@JsonProperty("SEngineClass")
@Valid
private String sEngineClass = null;
public CloudsStormVMs vms(List<CloudsStormVM> vms) { public CloudsStormVMs vms(List<CloudsStormVM> vms) {
this.vms = vms; this.vms = vms;
return this; return this;
......
...@@ -284,8 +284,8 @@ class CloudStormService { ...@@ -284,8 +284,8 @@ class CloudStormService {
private ToscaTemplate runCloudStorm(String tempInputDirPath) throws IOException, ApiException { private ToscaTemplate runCloudStorm(String tempInputDirPath) throws IOException, ApiException {
String[] args = new String[]{"run", tempInputDirPath}; String[] args = new String[]{"run", tempInputDirPath};
standalone.MainAsTool.main(args); // standalone.MainAsTool.main(args);
// tempInputDirPath = "/tmp/Input-87672007429577"; tempInputDirPath = "/tmp/Input-166590762352547";
CloudsStormTopTopology _top = objectMapper.readValue(new File(tempInputDirPath + TOPOLOGY_RELATIVE_PATH CloudsStormTopTopology _top = objectMapper.readValue(new File(tempInputDirPath + TOPOLOGY_RELATIVE_PATH
+ TOP_TOPOLOGY_FILE_NAME), + TOP_TOPOLOGY_FILE_NAME),
...@@ -304,7 +304,7 @@ class CloudStormService { ...@@ -304,7 +304,7 @@ class CloudStormService {
att.put("status", subTopology.getStatus().toString()); att.put("status", subTopology.getStatus().toString());
String rootKeyPairFolder = tempInputDirPath + TOPOLOGY_RELATIVE_PATH String rootKeyPairFolder = tempInputDirPath + TOPOLOGY_RELATIVE_PATH
+ TOP_TOPOLOGY_FILE_NAME + File.separator + subTopology.getSshKeyPairId(); + File.separator + subTopology.getSshKeyPairId();
Credential rootKeyPairCredential = new Credential(); Credential rootKeyPairCredential = new Credential();
rootKeyPairCredential.setProtocol("ssh"); rootKeyPairCredential.setProtocol("ssh");
Map<String, String> keys = new HashMap<>(); Map<String, String> keys = new HashMap<>();
...@@ -312,8 +312,7 @@ class CloudStormService { ...@@ -312,8 +312,7 @@ class CloudStormService {
keys.put("public_key", Converter.encodeFileToBase64Binary(rootKeyPairFolder + File.separator + "id_rsa.pub")); keys.put("public_key", Converter.encodeFileToBase64Binary(rootKeyPairFolder + File.separator + "id_rsa.pub"));
rootKeyPairCredential.setKeys(keys); rootKeyPairCredential.setKeys(keys);
String userKyePairFolder = tempInputDirPath + TOPOLOGY_RELATIVE_PATH String userKyePairFolder = tempInputDirPath + TOPOLOGY_RELATIVE_PATH;
+ TOP_TOPOLOGY_FILE_NAME;
Credential userKeyPairCredential = new Credential(); Credential userKeyPairCredential = new Credential();
userKeyPairCredential.setProtocol("ssh"); userKeyPairCredential.setProtocol("ssh");
keys = new HashMap<>(); keys = new HashMap<>();
...@@ -321,7 +320,7 @@ class CloudStormService { ...@@ -321,7 +320,7 @@ class CloudStormService {
keys.put("public_key", Converter.encodeFileToBase64Binary(userKyePairFolder + File.separator + "id_rsa.pub")); keys.put("public_key", Converter.encodeFileToBase64Binary(userKyePairFolder + File.separator + "id_rsa.pub"));
userKeyPairCredential.setKeys(keys); userKeyPairCredential.setKeys(keys);
CloudsStormVMs cloudsStormVMs = objectMapper.readValue(new File(tempInputDirPath + TOPOLOGY_RELATIVE_PATH + File.separator + subTopology.getTopology()), CloudsStormVMs cloudsStormVMs = objectMapper.readValue(new File(tempInputDirPath + TOPOLOGY_RELATIVE_PATH + File.separator + subTopology.getTopology()+".yml"),
CloudsStormVMs.class); CloudsStormVMs.class);
List<CloudsStormVM> vms = cloudsStormVMs.getVms(); List<CloudsStormVM> vms = cloudsStormVMs.getVms();
List<NodeTemplateMap> vmTemplatesMap = helper.getTemplateVMsForVMTopology(nodeTemplateMap); List<NodeTemplateMap> vmTemplatesMap = helper.getTemplateVMsForVMTopology(nodeTemplateMap);
......
...@@ -11,14 +11,10 @@ ...@@ -11,14 +11,10 @@
type: "string" type: "string"
publicAddress: publicAddress:
type: "string" type: "string"
type:
type: "string"
extraInfo: extraInfo:
type: object type: object
additionalProperties: additionalProperties:
type: object type: object
os:
type: "string"
CPU: CPU:
type: "string" type: "string"
MEM: MEM:
...@@ -34,6 +30,3 @@ ...@@ -34,6 +30,3 @@
selfEthAddresses: selfEthAddresses:
type: "string" type: "string"
CloudsStormVMs: CloudsStormVMs:
type: "object" type: "object"
properties: properties:
SEngineClass:
type: "string"
extraInfo:
type: object
additionalProperties:
type: object
VMs: VMs:
type: "array" type: "array"
items: items:
......
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