Commit 66d2733a authored by Spiros Koulouzis's avatar Spiros Koulouzis

fix case

parent 90353a03
......@@ -101,7 +101,7 @@ topology_template:
object_type: SubTopology
properties:
domain: UvA (Amsterdam, The Netherlands) XO Rack
provider: ExoGeni
provider: ExoGENI
requirements:
- vm:
capability: tosca.capabilities.ARTICONF.VM
......@@ -121,7 +121,7 @@ topology_template:
object_type: SubTopology
properties:
domain: UNC BEN (Chapel Hill, NC USA)
provider: ExoGeni
provider: ExoGENI
requirements:
- vm:
capability: tosca.capabilities.ARTICONF.VM
......
......@@ -110,8 +110,8 @@ node_types:
provider:
type: string
required: true
default: "ExoGeni"
description: The name of the provider e.g. EC2, ExoGeni etc.
default: "ExoGENI"
description: The name of the provider e.g. EC2, ExoGENI etc.
attributes:
credential:
type: tosca.datatypes.ARTICONF.Credential
......
......@@ -2,6 +2,8 @@ package nl.uva.sne.drip.model.cloud.storm;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.validation.annotation.Validated;
......@@ -9,17 +11,48 @@ import org.springframework.validation.annotation.Validated;
* CloudDB
*/
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-26T13:19:20.152Z")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-31T12:57:31.148Z")
public class CloudDB {
/**
* Gets or Sets cloudProvider
*/
public enum CloudProviderEnum {
EC2("EC2"),
EXOGENI("ExoGENI"),
EGI("EGI");
private String value;
CloudProviderEnum(String value) {
this.value = value;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static CloudProviderEnum fromValue(String text) {
for (CloudProviderEnum b : CloudProviderEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}
@JsonProperty("cloudProvider")
private String cloudProvider = null;
private CloudProviderEnum cloudProvider = null;
@JsonProperty("dbInfoFile")
private String dbInfoFile = null;
public CloudDB cloudProvider(String cloudProvider) {
public CloudDB cloudProvider(CloudProviderEnum cloudProvider) {
this.cloudProvider = cloudProvider;
return this;
}
......@@ -32,11 +65,11 @@ public class CloudDB {
*/
@ApiModelProperty(value = "")
public String getCloudProvider() {
public CloudProviderEnum getCloudProvider() {
return cloudProvider;
}
public void setCloudProvider(String cloudProvider) {
public void setCloudProvider(CloudProviderEnum cloudProvider) {
this.cloudProvider = cloudProvider;
}
......
......@@ -2,6 +2,8 @@ package nl.uva.sne.drip.model.cloud.storm;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
......@@ -12,18 +14,48 @@ import javax.validation.Valid;
* CloudsStormInfrasCode
*/
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-31T12:42:56.808Z")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-31T12:57:31.148Z")
public class CloudsStormInfrasCode {
/**
* Gets or Sets mode
*/
public enum ModeEnum {
LOCAL("LOCAL"),
CTRL("CTRL");
private String value;
ModeEnum(String value) {
this.value = value;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static ModeEnum fromValue(String text) {
for (ModeEnum b : ModeEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}
@JsonProperty("Mode")
private String mode = null;
private ModeEnum mode = null;
@JsonProperty("InfrasCodes")
@Valid
private List<InfrasCode> infrasCodes = null;
public CloudsStormInfrasCode mode(String mode) {
public CloudsStormInfrasCode mode(ModeEnum mode) {
this.mode = mode;
return this;
}
......@@ -36,11 +68,11 @@ public class CloudsStormInfrasCode {
*/
@ApiModelProperty(value = "")
public String getMode() {
public ModeEnum getMode() {
return mode;
}
public void setMode(String mode) {
public void setMode(ModeEnum mode) {
this.mode = mode;
}
......
......@@ -3,155 +3,188 @@ package nl.uva.sne.drip.model.cloud.storm;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import javax.validation.constraints.*;
/**
* CloudsStormSubTopology
*/
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-11T15:13:55.016Z")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CloudsStormSubTopology {
@JsonProperty("topology")
private String topology = null;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-31T12:57:31.148Z")
public class CloudsStormSubTopology {
@JsonProperty("topology")
private String topology = null;
@JsonProperty("cloudProvider")
private String cloudProvider = null;
@JsonProperty("domain")
private String domain = null;
/**
* Gets or Sets status
*/
public enum StatusEnum {
FRESH("fresh"),
RUNNING("running"),
DELETED("deleted"),
FAILED("failed"),
STOPPED("stopped");
private String value;
StatusEnum(String value) {
this.value = value;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static StatusEnum fromValue(String text) {
for (StatusEnum b : StatusEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}
@JsonProperty("cloudProvider")
private String cloudProvider = null;
@JsonProperty("status")
private StatusEnum status = null;
@JsonProperty("domain")
private String domain = null;
public CloudsStormSubTopology topology(String topology) {
this.topology = topology;
return this;
}
@JsonProperty("status")
private String status = null;
/**
* Get topology
*
* @return topology
*
*/
@ApiModelProperty(value = "")
public CloudsStormSubTopology topology(String topology) {
this.topology = topology;
return this;
}
/**
* Get topology
* @return topology
**/
@ApiModelProperty(value = "")
public String getTopology() {
return topology;
}
public void setTopology(String topology) {
this.topology = topology;
}
public CloudsStormSubTopology cloudProvider(String cloudProvider) {
this.cloudProvider = cloudProvider;
return this;
}
/**
* Get cloudProvider
* @return cloudProvider
**/
@ApiModelProperty(value = "")
public String getCloudProvider() {
return cloudProvider;
}
public void setCloudProvider(String cloudProvider) {
this.cloudProvider = cloudProvider;
}
public CloudsStormSubTopology domain(String domain) {
this.domain = domain;
return this;
}
/**
* Get domain
* @return domain
**/
@ApiModelProperty(value = "")
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
public CloudsStormSubTopology status(String status) {
this.status = status;
return this;
}
/**
* Get status
* @return status
**/
@ApiModelProperty(value = "")
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CloudsStormSubTopology cloudsStormSubTopology = (CloudsStormSubTopology) o;
return Objects.equals(this.topology, cloudsStormSubTopology.topology) &&
Objects.equals(this.cloudProvider, cloudsStormSubTopology.cloudProvider) &&
Objects.equals(this.domain, cloudsStormSubTopology.domain) &&
Objects.equals(this.status, cloudsStormSubTopology.status);
}
@Override
public int hashCode() {
return Objects.hash(topology, cloudProvider, domain, status);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CloudsStormSubTopology {\n");
sb.append(" topology: ").append(toIndentedString(topology)).append("\n");
sb.append(" cloudProvider: ").append(toIndentedString(cloudProvider)).append("\n");
sb.append(" domain: ").append(toIndentedString(domain)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
public String getTopology() {
return topology;
}
public void setTopology(String topology) {
this.topology = topology;
}
public CloudsStormSubTopology cloudProvider(String cloudProvider) {
this.cloudProvider = cloudProvider;
return this;
}
/**
* Get cloudProvider
*
* @return cloudProvider
*
*/
@ApiModelProperty(value = "")
public String getCloudProvider() {
return cloudProvider;
}
public void setCloudProvider(String cloudProvider) {
this.cloudProvider = cloudProvider;
}
public CloudsStormSubTopology domain(String domain) {
this.domain = domain;
return this;
}
/**
* Get domain
*
* @return domain
*
*/
@ApiModelProperty(value = "")
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
public CloudsStormSubTopology status(StatusEnum status) {
this.status = status;
return this;
}
/**
* Get status
*
* @return status
*
*/
@ApiModelProperty(value = "")
public StatusEnum getStatus() {
return status;
}
public void setStatus(StatusEnum status) {
this.status = status;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CloudsStormSubTopology cloudsStormSubTopology = (CloudsStormSubTopology) o;
return Objects.equals(this.topology, cloudsStormSubTopology.topology)
&& Objects.equals(this.cloudProvider, cloudsStormSubTopology.cloudProvider)
&& Objects.equals(this.domain, cloudsStormSubTopology.domain)
&& Objects.equals(this.status, cloudsStormSubTopology.status);
}
@Override
public int hashCode() {
return Objects.hash(topology, cloudProvider, domain, status);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CloudsStormSubTopology {\n");
sb.append(" topology: ").append(toIndentedString(topology)).append("\n");
sb.append(" cloudProvider: ").append(toIndentedString(cloudProvider)).append("\n");
sb.append(" domain: ").append(toIndentedString(domain)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
......@@ -2,16 +2,12 @@ package nl.uva.sne.drip.model.cloud.storm;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import nl.uva.sne.drip.model.cloud.storm.CloudsStormSubMembers;
import java.util.ArrayList;
import java.util.List;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import javax.validation.constraints.*;
/**
* CloudsStormSubnets
......
package nl.uva.sne.drip.model.cloud.storm;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.Map;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
/**
* Credential
*/
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-31T12:57:31.148Z")
public class Credential {
@JsonProperty("protocol")
private String protocol = null;
@JsonProperty("token_type")
private String tokenType = null;
@JsonProperty("token")
private String token = null;
@JsonProperty("keys")
@Valid
private Map<String, String> keys = null;
@JsonProperty("user")
private String user = null;
@JsonProperty("cloud_provider_name")
private String cloudProviderName = null;
public Credential protocol(String protocol) {
this.protocol = protocol;
return this;
}
/**
* The optional protocol name. e.g. http,xauth,oauth2,ssh
*
* @return protocol
*
*/
@ApiModelProperty(value = "The optional protocol name. e.g. http,xauth,oauth2,ssh")
public String getProtocol() {
return protocol;
}
public void setProtocol(String protocol) {
this.protocol = protocol;
}
public Credential tokenType(String tokenType) {
this.tokenType = tokenType;
return this;
}
/**
* The required token type. default: password. e.g. basic_auth,X-Auth-Token,
* bearer, identifier
*
* @return tokenType
*
*/
@ApiModelProperty(value = "The required token type. default: password. e.g. basic_auth,X-Auth-Token, bearer, identifier")
public String getTokenType() {
return tokenType;
}
public void setTokenType(String tokenType) {
this.tokenType = tokenType;
}
public Credential token(String token) {
this.token = token;
return this;
}
/**
* The required token used as a credential for authorization or access to a
* networked resource. e.g. mypassword, myusername:mypassword,
* 604bbe45ac7143a79e14f3158df67091, keypair_id
*
* @return token
*
*/
@ApiModelProperty(value = "The required token used as a credential for authorization or access to a networked resource. e.g. mypassword, myusername:mypassword, 604bbe45ac7143a79e14f3158df67091, keypair_id")
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public Credential keys(Map<String, String> keys) {
this.keys = keys;
return this;
}
public Credential putKeysItem(String key, String keysItem) {
if (this.keys == null) {
this.keys = new HashMap<String, String>();
}
this.keys.put(key, keysItem);
return this;
}
/**
* The optional list of protocol-specific keys or assertions.
*
* @return keys
*
*/
@ApiModelProperty(value = "The optional list of protocol-specific keys or assertions.")
public Map<String, String> getKeys() {
return keys;
}
public void setKeys(Map<String, String> keys) {
this.keys = keys;
}
public Credential user(String user) {
this.user = user;
return this;
}
/**
* The optional user (name or ID) used for non-token based credentials.
*
* @return user
*
*/
@ApiModelProperty(value = "The optional user (name or ID) used for non-token based credentials.")
public String getUser() {
return user;
}
public void setUser(String user) {
this.user = user;
}
public Credential cloudProviderName(String cloudProviderName) {
this.cloudProviderName = cloudProviderName;
return this;
}
/**
* The cloud provider name e.g. ec2.
*
* @return cloudProviderName
*
*/
@ApiModelProperty(value = "The cloud provider name e.g. ec2.")
public String getCloudProviderName() {
return cloudProviderName;
}
public void setCloudProviderName(String cloudProviderName) {
this.cloudProviderName = cloudProviderName;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Credential credential = (Credential) o;
return Objects.equals(this.protocol, credential.protocol)
&& Objects.equals(this.tokenType, credential.tokenType)
&& Objects.equals(this.token, credential.token)
&& Objects.equals(this.keys, credential.keys)
&& Objects.equals(this.user, credential.user)
&& Objects.equals(this.cloudProviderName, credential.cloudProviderName);
}
@Override
public int hashCode() {
return Objects.hash(protocol, tokenType, token, keys, user, cloudProviderName);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Credential {\n");
sb.append(" protocol: ").append(toIndentedString(protocol)).append("\n");
sb.append(" tokenType: ").append(toIndentedString(tokenType)).append("\n");
sb.append(" token: ").append(toIndentedString(token)).append("\n");
sb.append(" keys: ").append(toIndentedString(keys)).append("\n");
sb.append(" user: ").append(toIndentedString(user)).append("\n");
sb.append(" cloudProviderName: ").append(toIndentedString(cloudProviderName)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
......@@ -9,7 +9,7 @@ import org.springframework.validation.annotation.Validated;
* CredentialInfo
*/
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-24T17:07:10.081Z")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-31T12:57:31.148Z")
public class CredentialInfo {
......
......@@ -2,8 +2,9 @@ package nl.uva.sne.drip.model.cloud.storm;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.model.OpCode;
import java.util.ArrayList;
import java.util.List;
import org.springframework.validation.annotation.Validated;
......@@ -13,12 +14,42 @@ import javax.validation.Valid;
* InfrasCode
*/
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-31T12:42:56.808Z")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-31T12:57:31.148Z")
public class InfrasCode {
/**
* Gets or Sets codeType
*/
public enum CodeTypeEnum {
SEQ("SEQ"),
LOOP("LOOP");
private String value;
CodeTypeEnum(String value) {
this.value = value;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static CodeTypeEnum fromValue(String text) {
for (CodeTypeEnum b : CodeTypeEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}
@JsonProperty("CodeType")
private String codeType = null;
private CodeTypeEnum codeType = null;
@JsonProperty("OpCode")
private OpCode opCode = null;
......@@ -26,11 +57,11 @@ public class InfrasCode {
@JsonProperty("Count")
private Integer count = null;
@JsonProperty("OpCodes")
@Valid
private List<OpCode> opCodes = null;
// @JsonProperty("OpCodes")
// @Valid
// private List<OpCode> opCodes = null;
public InfrasCode codeType(String codeType) {
public InfrasCode codeType(CodeTypeEnum codeType) {
this.codeType = codeType;
return this;
}
......@@ -43,11 +74,11 @@ public class InfrasCode {
*/
@ApiModelProperty(value = "")
public String getCodeType() {
public CodeTypeEnum getCodeType() {
return codeType;
}
public void setCodeType(String codeType) {
public void setCodeType(CodeTypeEnum codeType) {
this.codeType = codeType;
}
......@@ -95,36 +126,36 @@ public class InfrasCode {
this.count = count;
}
public InfrasCode opCodes(List<OpCode> opCodes) {
this.opCodes = opCodes;
return this;
}
public InfrasCode addOpCodesItem(OpCode opCodesItem) {
if (this.opCodes == null) {
this.opCodes = new ArrayList<OpCode>();
}
this.opCodes.add(opCodesItem);
return this;
}
/**
* Get opCodes
*
* @return opCodes
*
*/
@ApiModelProperty(value = "")
@Valid
public List<OpCode> getOpCodes() {
return opCodes;
}
public void setOpCodes(List<OpCode> opCodes) {
this.opCodes = opCodes;
}
// public InfrasCode opCodes(List<OpCode> opCodes) {
// this.opCodes = opCodes;
// return this;
// }
//
// public InfrasCode addOpCodesItem(OpCode opCodesItem) {
// if (this.opCodes == null) {
// this.opCodes = new ArrayList<OpCode>();
// }
// this.opCodes.add(opCodesItem);
// return this;
// }
//
// /**
// * Get opCodes
// *
// * @return opCodes
// *
// */
// @ApiModelProperty(value = "")
//
// @Valid
//
// public List<OpCode> getOpCodes() {
// return opCodes;
// }
//
// public void setOpCodes(List<OpCode> opCodes) {
// this.opCodes = opCodes;
// }
@Override
public boolean equals(java.lang.Object o) {
......@@ -137,13 +168,13 @@ public class InfrasCode {
InfrasCode infrasCode = (InfrasCode) o;
return Objects.equals(this.codeType, infrasCode.codeType)
&& Objects.equals(this.opCode, infrasCode.opCode)
&& Objects.equals(this.count, infrasCode.count)
&& Objects.equals(this.opCodes, infrasCode.opCodes);
&& Objects.equals(this.count, infrasCode.count);
// && Objects.equals(this.opCodes, infrasCode.opCodes);
}
@Override
public int hashCode() {
return Objects.hash(codeType, opCode, count, opCodes);
return Objects.hash(codeType, opCode, count); //, opCodes);
}
@Override
......@@ -154,7 +185,7 @@ public class InfrasCode {
sb.append(" codeType: ").append(toIndentedString(codeType)).append("\n");
sb.append(" opCode: ").append(toIndentedString(opCode)).append("\n");
sb.append(" count: ").append(toIndentedString(count)).append("\n");
sb.append(" opCodes: ").append(toIndentedString(opCodes)).append("\n");
// sb.append(" opCodes: ").append(toIndentedString(opCodes)).append("\n");
sb.append("}");
return sb.toString();
}
......
......@@ -2,8 +2,9 @@ package nl.uva.sne.drip.model.cloud.storm;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.model.Options;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
......@@ -11,12 +12,83 @@ import javax.validation.Valid;
* OpCode
*/
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-31T12:42:56.808Z")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-31T12:57:31.148Z")
public class OpCode {
/**
* Gets or Sets operation
*/
public enum OperationEnum {
PROVISION("provision"),
DELETE("delete"),
EXECUTE("execute"),
PUT("put"),
GET("get"),
VSCALE("vscale"),
HSCALE("hscale"),
RECOVER("recover"),
START("start");
private String value;
OperationEnum(String value) {
this.value = value;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static OperationEnum fromValue(String text) {
for (OperationEnum b : OperationEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}
@JsonProperty("Operation")
private String operation = null;
private OperationEnum operation = null;
/**
* Gets or Sets objectType
*/
public enum ObjectTypeEnum {
SUBTOPOLOGY("SubTopology"),
VM("VM"),
REQ("REQ");
private String value;
ObjectTypeEnum(String value) {
this.value = value;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
@JsonCreator
public static ObjectTypeEnum fromValue(String text) {
for (ObjectTypeEnum b : ObjectTypeEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
}
@JsonProperty("ObjectType")
private ObjectTypeEnum objectType = null;
@JsonProperty("Objects")
private String objects = null;
......@@ -30,7 +102,7 @@ public class OpCode {
@JsonProperty("Options")
private Options options = null;
public OpCode operation(String operation) {
public OpCode operation(OperationEnum operation) {
this.operation = operation;
return this;
}
......@@ -43,14 +115,35 @@ public class OpCode {
*/
@ApiModelProperty(value = "")
public String getOperation() {
public OperationEnum getOperation() {
return operation;
}
public void setOperation(String operation) {
public void setOperation(OperationEnum operation) {
this.operation = operation;
}
public OpCode objectType(ObjectTypeEnum objectType) {
this.objectType = objectType;
return this;
}
/**
* Get objectType
*
* @return objectType
*
*/
@ApiModelProperty(value = "")
public ObjectTypeEnum getObjectType() {
return objectType;
}
public void setObjectType(ObjectTypeEnum objectType) {
this.objectType = objectType;
}
public OpCode objects(String objects) {
this.objects = objects;
return this;
......@@ -147,6 +240,7 @@ public class OpCode {
}
OpCode opCode = (OpCode) o;
return Objects.equals(this.operation, opCode.operation)
&& Objects.equals(this.objectType, opCode.objectType)
&& Objects.equals(this.objects, opCode.objects)
&& Objects.equals(this.command, opCode.command)
&& Objects.equals(this.log, opCode.log)
......@@ -155,7 +249,7 @@ public class OpCode {
@Override
public int hashCode() {
return Objects.hash(operation, objects, command, log, options);
return Objects.hash(operation, objectType, objects, command, log, options);
}
@Override
......@@ -164,6 +258,7 @@ public class OpCode {
sb.append("class OpCode {\n");
sb.append(" operation: ").append(toIndentedString(operation)).append("\n");
sb.append(" objectType: ").append(toIndentedString(objectType)).append("\n");
sb.append(" objects: ").append(toIndentedString(objects)).append("\n");
sb.append(" command: ").append(toIndentedString(command)).append("\n");
sb.append(" log: ").append(toIndentedString(log)).append("\n");
......
......@@ -9,7 +9,7 @@ import org.springframework.validation.annotation.Validated;
* Options
*/
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-31T12:42:56.808Z")
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-31T12:57:31.148Z")
public class Options {
......
......@@ -36,14 +36,14 @@ class CloudStormDAO {
objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
}
List<VMMetaInfo> findVmMetaInfoByProvider(String provider) throws IOException {
List<VMMetaInfo> findVmMetaInfoByProvider(CloudDB.CloudProviderEnum provider) throws IOException {
DB db = objectMapper.readValue(new File(cloudStormDBPath + File.separator + "db.yml"), DB.class);
List<CloudDB> cloudDBs = db.getCloudDBs();
CloudDB targetCloudDB = null;
for (CloudDB cloudDB : cloudDBs) {
if (cloudDB.getCloudProvider().toLowerCase().equals(provider.toLowerCase())) {
if (cloudDB.getCloudProvider().equals(provider)) {
targetCloudDB = cloudDB;
break;
}
......
......@@ -31,11 +31,14 @@ import nl.uva.sne.drip.model.cloud.storm.CloudsStormVM;
import nl.uva.sne.drip.model.NodeTemplateMap;
import nl.uva.sne.drip.model.cloud.storm.CloudCred;
import nl.uva.sne.drip.model.cloud.storm.CloudCredentialDB;
import nl.uva.sne.drip.model.cloud.storm.CloudDB;
import nl.uva.sne.drip.model.cloud.storm.CloudsStormInfrasCode;
import nl.uva.sne.drip.model.cloud.storm.CloudsStormSubTopology;
import nl.uva.sne.drip.model.cloud.storm.CloudsStormTopTopology;
import nl.uva.sne.drip.model.cloud.storm.CloudsStormVMs;
import nl.uva.sne.drip.model.cloud.storm.CredentialInfo;
import nl.uva.sne.drip.model.cloud.storm.InfrasCode;
import nl.uva.sne.drip.model.cloud.storm.OpCode;
import nl.uva.sne.drip.model.cloud.storm.VMMetaInfo;
import nl.uva.sne.drip.model.tosca.Credential;
import nl.uva.sne.drip.model.tosca.ToscaTemplate;
......@@ -140,7 +143,7 @@ class CloudStormService {
cloudsStormSubTopology.setDomain(domain);
cloudsStormSubTopology.setCloudProvider(provider);
cloudsStormSubTopology.setTopology("vm_topology" + i);
cloudsStormSubTopology.setStatus("fresh");
cloudsStormSubTopology.setStatus(CloudsStormSubTopology.StatusEnum.FRESH);
CloudsStormVMs cloudsStormVMs = new CloudsStormVMs();
List<CloudsStormVM> vms = new ArrayList<>();
......@@ -148,7 +151,8 @@ class CloudStormService {
int j = 0;
for (NodeTemplateMap vmMap : vmTemplatesMap) {
CloudsStormVM cloudsStormVM = new CloudsStormVM();
String vmType = getVMType(vmMap, provider);
CloudDB.CloudProviderEnum cloudProviderEnum = CloudDB.CloudProviderEnum.valueOf(provider);
String vmType = getVMType(vmMap, cloudProviderEnum);
cloudsStormVM.setNodeType(vmType);
cloudsStormVM.setName("vm" + j);
String os = helper.getVMNOS(vmMap);
......@@ -167,7 +171,7 @@ class CloudStormService {
return cloudsStormMap;
}
private String getVMType(NodeTemplateMap vmMap, String provider) throws IOException, Exception {
private String getVMType(NodeTemplateMap vmMap, CloudDB.CloudProviderEnum provider) throws IOException, Exception {
Double numOfCores = helper.getVMNumOfCores(vmMap);
Double memSize = helper.getVMNMemSize(vmMap);
String os = helper.getVMNOS(vmMap);
......@@ -226,19 +230,28 @@ class CloudStormService {
return null;
}
private void writeCloudStormInfrasCodeFiles(String infrasCodeTempInputDirPath, List<CloudsStormSubTopology> cloudStormSubtopologies) throws ApiException {
private void writeCloudStormInfrasCodeFiles(String infrasCodeTempInputDirPath, List<CloudsStormSubTopology> cloudStormSubtopologies) throws ApiException, IOException {
List<NodeTemplateMap> vmTopologiesMaps = helper.getVMTopologyTemplates();
int i = 0;
CloudsStormInfrasCode cloudsStormInfrasCode =new CloudsStormInfrasCode();
cloudsStormInfrasCode.setMode("");
List<InfrasCode> infrasCodes = new ArrayList<>();
for (NodeTemplateMap vmTopologyMap : vmTopologiesMaps) {
Map<String, Object> provisionInterface = helper.getProvisionerInterfaceFromVMTopology(vmTopologyMap);
String operation = provisionInterface.keySet().iterator().next();
Map<String, Object> inputs = (Map<String, Object>) provisionInterface.get(operation);
inputs.put("object_type", cloudStormSubtopologies.get(i).getTopology());
OpCode opCode = new OpCode();
opCode.setLog(Boolean.FALSE);
opCode.setObjectType(OpCode.ObjectTypeEnum.SUBTOPOLOGY);
opCode.setObjects(cloudStormSubtopologies.get(i).getTopology());
InfrasCode infrasCode = new InfrasCode();
infrasCode.setCodeType(InfrasCode.CodeTypeEnum.SEQ);
infrasCode.setOpCode(opCode);
}
CloudsStormInfrasCode cloudsStormInfrasCode = new CloudsStormInfrasCode();
cloudsStormInfrasCode.setMode(CloudsStormInfrasCode.ModeEnum.LOCAL);
cloudsStormInfrasCode.setInfrasCodes(infrasCodes);
objectMapper.writeValue(new File(infrasCodeTempInputDirPath + File.separator + "infrasCode.yml"), cloudsStormInfrasCode);
}
}
......@@ -8,7 +8,7 @@
$ref: "https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/openAPI/schema/CloudStorm/OpCode.yml#/OpCode"
Count:
type: "integer"
OpCodes:
type: "array"
items:
$ref: "https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/openAPI/schema/CloudStorm/OpCode.yml#/OpCode"
#OpCodes:
#type: "array"
#items:
#$ref: "https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/openAPI/schema/CloudStorm/OpCode.yml#/OpCode"
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