Commit 90353a03 authored by Spiros Koulouzis's avatar Spiros Koulouzis

added enum to schema

parent c1bc5074
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.ArrayList;
import java.util.List;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
/**
* CloudsStormInfrasCode
*/
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-31T12:42:56.808Z")
public class CloudsStormInfrasCode {
@JsonProperty("Mode")
private String mode = null;
@JsonProperty("InfrasCodes")
@Valid
private List<InfrasCode> infrasCodes = null;
public CloudsStormInfrasCode mode(String mode) {
this.mode = mode;
return this;
}
/**
* Get mode
*
* @return mode
*
*/
@ApiModelProperty(value = "")
public String getMode() {
return mode;
}
public void setMode(String mode) {
this.mode = mode;
}
public CloudsStormInfrasCode infrasCodes(List<InfrasCode> infrasCodes) {
this.infrasCodes = infrasCodes;
return this;
}
public CloudsStormInfrasCode addInfrasCodesItem(InfrasCode infrasCodesItem) {
if (this.infrasCodes == null) {
this.infrasCodes = new ArrayList<InfrasCode>();
}
this.infrasCodes.add(infrasCodesItem);
return this;
}
/**
* Get infrasCodes
*
* @return infrasCodes
*
*/
@ApiModelProperty(value = "")
@Valid
public List<InfrasCode> getInfrasCodes() {
return infrasCodes;
}
public void setInfrasCodes(List<InfrasCode> infrasCodes) {
this.infrasCodes = infrasCodes;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CloudsStormInfrasCode cloudsStormInfrasCode = (CloudsStormInfrasCode) o;
return Objects.equals(this.mode, cloudsStormInfrasCode.mode)
&& Objects.equals(this.infrasCodes, cloudsStormInfrasCode.infrasCodes);
}
@Override
public int hashCode() {
return Objects.hash(mode, infrasCodes);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CloudsStormInfrasCode {\n");
sb.append(" mode: ").append(toIndentedString(mode)).append("\n");
sb.append(" infrasCodes: ").append(toIndentedString(infrasCodes)).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 ");
}
}
package nl.uva.sne.drip.model.cloud.storm;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.model.OpCode;
import java.util.ArrayList;
import java.util.List;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
/**
* InfrasCode
*/
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-31T12:42:56.808Z")
public class InfrasCode {
@JsonProperty("CodeType")
private String codeType = null;
@JsonProperty("OpCode")
private OpCode opCode = null;
@JsonProperty("Count")
private Integer count = null;
@JsonProperty("OpCodes")
@Valid
private List<OpCode> opCodes = null;
public InfrasCode codeType(String codeType) {
this.codeType = codeType;
return this;
}
/**
* Get codeType
*
* @return codeType
*
*/
@ApiModelProperty(value = "")
public String getCodeType() {
return codeType;
}
public void setCodeType(String codeType) {
this.codeType = codeType;
}
public InfrasCode opCode(OpCode opCode) {
this.opCode = opCode;
return this;
}
/**
* Get opCode
*
* @return opCode
*
*/
@ApiModelProperty(value = "")
@Valid
public OpCode getOpCode() {
return opCode;
}
public void setOpCode(OpCode opCode) {
this.opCode = opCode;
}
public InfrasCode count(Integer count) {
this.count = count;
return this;
}
/**
* Get count
*
* @return count
*
*/
@ApiModelProperty(value = "")
public Integer getCount() {
return count;
}
public void setCount(Integer count) {
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;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
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);
}
@Override
public int hashCode() {
return Objects.hash(codeType, opCode, count, opCodes);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class InfrasCode {\n");
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("}");
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 ");
}
}
package nl.uva.sne.drip.model.cloud.storm;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.model.Options;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
/**
* OpCode
*/
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-31T12:42:56.808Z")
public class OpCode {
@JsonProperty("Operation")
private String operation = null;
@JsonProperty("Objects")
private String objects = null;
@JsonProperty("Command")
private String command = null;
@JsonProperty("Log")
private Boolean log = null;
@JsonProperty("Options")
private Options options = null;
public OpCode operation(String operation) {
this.operation = operation;
return this;
}
/**
* Get operation
*
* @return operation
*
*/
@ApiModelProperty(value = "")
public String getOperation() {
return operation;
}
public void setOperation(String operation) {
this.operation = operation;
}
public OpCode objects(String objects) {
this.objects = objects;
return this;
}
/**
* Get objects
*
* @return objects
*
*/
@ApiModelProperty(value = "")
public String getObjects() {
return objects;
}
public void setObjects(String objects) {
this.objects = objects;
}
public OpCode command(String command) {
this.command = command;
return this;
}
/**
* Get command
*
* @return command
*
*/
@ApiModelProperty(value = "")
public String getCommand() {
return command;
}
public void setCommand(String command) {
this.command = command;
}
public OpCode log(Boolean log) {
this.log = log;
return this;
}
/**
* Get log
*
* @return log
*
*/
@ApiModelProperty(value = "")
public Boolean isLog() {
return log;
}
public void setLog(Boolean log) {
this.log = log;
}
public OpCode options(Options options) {
this.options = options;
return this;
}
/**
* Get options
*
* @return options
*
*/
@ApiModelProperty(value = "")
@Valid
public Options getOptions() {
return options;
}
public void setOptions(Options options) {
this.options = options;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
OpCode opCode = (OpCode) o;
return Objects.equals(this.operation, opCode.operation)
&& Objects.equals(this.objects, opCode.objects)
&& Objects.equals(this.command, opCode.command)
&& Objects.equals(this.log, opCode.log)
&& Objects.equals(this.options, opCode.options);
}
@Override
public int hashCode() {
return Objects.hash(operation, objects, command, log, options);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class OpCode {\n");
sb.append(" operation: ").append(toIndentedString(operation)).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");
sb.append(" options: ").append(toIndentedString(options)).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 ");
}
}
package nl.uva.sne.drip.model.cloud.storm;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.validation.annotation.Validated;
/**
* Options
*/
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-31T12:42:56.808Z")
public class Options {
@JsonProperty("Src")
private String src = null;
@JsonProperty("Dst")
private String dst = null;
public Options src(String src) {
this.src = src;
return this;
}
/**
* Get src
*
* @return src
*
*/
@ApiModelProperty(value = "")
public String getSrc() {
return src;
}
public void setSrc(String src) {
this.src = src;
}
public Options dst(String dst) {
this.dst = dst;
return this;
}
/**
* Get dst
*
* @return dst
*
*/
@ApiModelProperty(value = "")
public String getDst() {
return dst;
}
public void setDst(String dst) {
this.dst = dst;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Options options = (Options) o;
return Objects.equals(this.src, options.src)
&& Objects.equals(this.dst, options.dst);
}
@Override
public int hashCode() {
return Objects.hash(src, dst);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class Options {\n");
sb.append(" src: ").append(toIndentedString(src)).append("\n");
sb.append(" dst: ").append(toIndentedString(dst)).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 ");
}
}
......@@ -31,6 +31,7 @@ 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.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;
......@@ -228,7 +229,8 @@ class CloudStormService {
private void writeCloudStormInfrasCodeFiles(String infrasCodeTempInputDirPath, List<CloudsStormSubTopology> cloudStormSubtopologies) throws ApiException {
List<NodeTemplateMap> vmTopologiesMaps = helper.getVMTopologyTemplates();
int i = 0;
InfrasCodes ce =new
CloudsStormInfrasCode cloudsStormInfrasCode =new CloudsStormInfrasCode();
cloudsStormInfrasCode.setMode("");
for (NodeTemplateMap vmTopologyMap : vmTopologiesMaps) {
Map<String, Object> provisionInterface = helper.getProvisionerInterfaceFromVMTopology(vmTopologyMap);
String operation = provisionInterface.keySet().iterator().next();
......
......@@ -3,5 +3,6 @@
properties:
cloudProvider:
type: "string"
enum: [EC2 , ExoGENI , EGI]
dbInfoFile:
type: "string"
......@@ -3,6 +3,7 @@
properties:
Mode:
type: "string"
enum: [LOCAL, CTRL]
InfrasCodes:
type: "array"
items:
......
......@@ -9,3 +9,5 @@
type: "string"
status:
type: "string"
enum: [fresh , running , deleted , failed , stopped]
......@@ -3,6 +3,7 @@
properties:
CodeType:
type: "string"
enum: [SEQ, LOOP]
OpCode:
$ref: "https://raw.githubusercontent.com/skoulouzis/CONF/DRIP_3.0/openAPI/schema/CloudStorm/OpCode.yml#/OpCode"
Count:
......
......@@ -3,6 +3,10 @@
properties:
Operation:
type: "string"
enum: [provision , delete , execute , put , get , vscale , hscale , recover , start]
ObjectType:
type: "string"
enum: [SubTopology , VM , REQ]
Objects:
type: "string"
Command:
......
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