Commit 2a59a2d7 authored by skoulouzis's avatar skoulouzis

update

parent 1c43a702
......@@ -16,10 +16,7 @@ do
cd $python_project
rm -rf venv
python3 -m venv venv
venv/bin/pip3 install pip --upgrade
venv/bin/pip3 install setuptools --upgrade
venv/bin/pip3 install -r requirements.txt
if [ "$python_project" == "deployer" ]; then
cd ../semaphore-python-client-generated
../$python_project/venv/bin/python setup.py install
......
#!/bin/bash
docker push qcdis/manager
docker push qcdis/provisioner
docker push qcdis/sure-tosca
docker push qcdis/planner
docker push qcdis/deployer
docker push qcdis/manager:3.0.0
docker push qcdis/provisioner:3.0.0
# docker push qcdis/sure-tosca:3.0.0
# docker push qcdis/planner:3.0.0
# docker push qcdis/deployer:3.0.0
......@@ -4,27 +4,27 @@ echo "----------Building manager Docker--------------"
cd manager && mvn -Dmaven.test.skip=true dockerfile:build
status=$?
[ $status -eq 0 ] && echo "build successful" || exit -1
cd ../
echo "----------Building provisioner Docker--------------"
cd provisioner && mvn -Dmaven.test.skip=true dockerfile:build
[ $status -eq 0 ] && echo "build successful" || exit -1
cd ../
echo "----------Building sure_tosca-flask-server Docker--------------"
cd sure_tosca-flask-server && docker build -t sure-tosca .
[ $status -eq 0 ] && echo "build successful" || exit -1
echo "----------Building planner Docker--------------"
cd ../
cd planner && docker build -t planner .
[ $status -eq 0 ] && echo "build successful" || exit -1
echo "----------Building deployer Docker--------------"
cd ../
cd deployer && docker build -t deployer .
[ $status -eq 0 ] && echo "build successful" || exit -1
# cd ../
# echo "----------Building provisioner Docker--------------"
# cd provisioner && mvn -Dmaven.test.skip=true dockerfile:build
# [ $status -eq 0 ] && echo "build successful" || exit -1
# cd ../
# echo "----------Building sure_tosca-flask-server Docker--------------"
# cd sure_tosca-flask-server && docker build -t sure-tosca:3.0.0 .
# [ $status -eq 0 ] && echo "build successful" || exit -1
# echo "----------Building planner Docker--------------"
# cd ../
# cd planner && docker build -t planner:3.0.0 .
# [ $status -eq 0 ] && echo "build successful" || exit -1
# echo "----------Building deployer Docker--------------"
# cd ../
# cd deployer && docker build -t deployer:3.0.0 .
# [ $status -eq 0 ] && echo "build successful" || exit -1
docker tag sure-tosca qcdis/sure-tosca
docker tag planner qcdis/planner
docker tag deployer qcdis/deployer
docker tag manager:3.0.0 qcdis/manager
docker tag provisioner:3.0.0 qcdis/provisioner
# docker tag sure-tosca:3.0.0 qcdis/sure-tosca:3.0.0
# docker tag planner:3.0.0 qcdis/planner:3.0.0
# docker tag deployer:3.0.0 qcdis/deployer:3.0.0
docker tag manager:3.0.0 qcdis/manager:3.0.0
# docker tag provisioner:3.0.0 qcdis/provisioner:3.0.0
#!/bin/bash
cd ../
python3 -m venv venv
cd sure_tosca-flask-server && python3 -m venv venv && venv/bin/pip3 install -r test-requirements.txt && venv/bin/pip3 install -r requirements.txt && venv/bin/python3 -m unittest discover
if [ $? -eq 0 ]
then
echo "------- sure_tosca-flask-server tests successful------"
docker build -t sure-tosca:3.0.0 .
docker tag sure-tosca:3.0.0 qcdis/sure-tosca:3.0.0
else
echo "sure_tosca-flask-server tests Failed"
exit 1
fi
docker stack deploy conf-test -c ../docker-compose/docker-compose-test.yml
docker stack deploy conf-test -c ../docker-compose-test.yml
sure_tosca_url=http://127.0.0.1:8081/tosca-sure/1.0.0/ui
sure_tosca_url=http://localhost:8081
echo "Waiting for $sure_tosca_url"
count=0 && until $(curl --output /dev/null --silent --head --fail "$sure_tosca_url"); do printf '.' && sleep 10 && count=$((count+1)) && if [ $count -gt 5 ]; then break; fi; done
......@@ -31,58 +17,33 @@ fi
cd ../
mvn test
if [ $? -eq 0 ]
then
echo "------- Java tests successful------"
else
echo "Java tests Failed"
docker stack rm conf-test
exit 1
fi
status=$?
[ $status -eq 0 ] && echo "------- Java tests successful------" || exit -1
cd planner && python3 -m venv venv && venv/bin/pip3 install -r test-requirements.txt && venv/bin/pip3 install -r requirements.txt && venv/bin/python3 -m unittest discover
if [ $? -eq 0 ]
then
echo "------- Planner tests successful------"
else
echo "Planner tests Failed"
docker stack rm conf-test
exit 1
fi
cd planner && venv/bin/python3 -m unittest discover
status=$?
[ $status -eq 0 ] && echo "------- Planner tests successful------" || exit -1
cd ../
cd sure_tosca-flask-server && venv/bin/python3 -m unittest discover
status=$?
[ $status -eq 0 ] && echo "------- sure_tosca-flask-server tests successful------" || exit -1
cd ../
cd sure_tosca-client_python_stubs && python3 -m venv venv && venv/bin/pip3 install -r test-requirements.txt && venv/bin/pip3 install -r requirements.txt && venv/bin/python3 -m unittest discover
if [ $? -eq 0 ]
then
echo "------- sure_tosca-client_python_stubs tests successful------"
else
echo "sure_tosca-client_python_stubs tests Failed"
docker stack rm conf-test
exit 1
fi
cd sure_tosca-client_python_stubs && venv/bin/python3 -m unittest discover
status=$?
[ $status -eq 0 ] && echo "------- sure_tosca-client_python_stubs tests successful------" || exit -1
cd ../
cd semaphore-python-client-generated && python3 -m venv venv && venv/bin/pip3 install -r test-requirements.txt && venv/bin/pip3 install -r requirements.txt && venv/bin/python3 -m unittest discover
if [ $? -eq 0 ]
then
echo "------- semaphore-python-client-generated tests successful ------"
else
echo "semaphore-python-client-generated tests Failed"
docker stack rm conf-test
exit 1
fi
cd semaphore-python-client-generated && venv/bin/python3 -m unittest discover
status=$?
[ $status -eq 0 ] && echo "------- semaphore-python-client-generated tests successful------" || exit -1
#cd ../
#cd deployer && python3 -m venv venv && venv/bin/pip3 install -U pip setuptools && venv/bin/pip3 install -r test-requirements.txt && venv/bin/pip3 install -r requirements.txt && venv/bin/python3 -m unittest discover
#if [ $? -eq 0 ]
#then
# echo "------- deployer tests successful ------"
#else
# echo "deployer tests Failed"
# docker stack rm conf-test
# exit 1
#fi
cd ../
cd deployer && venv/bin/python3 -m unittest discover
status=$?
[ $status -eq 0 ] && echo "------- deployer tests successful------" || exit -1
docker stack rm conf-test
......@@ -16,7 +16,6 @@
package nl.uva.sne.drip.commons.utils;
/**
*
* @author S. Koulouzis
*/
public class Constants {
......@@ -33,7 +32,7 @@ public class Constants {
public static final String ENCODED_FILE_DATATYPE = "tosca.datatypes.QC.encodedFile";
public static final String CLOUD_STORM_FILES_ZIP_SUFIX = "cloudStromFiles.zip";
public static enum NODE_STATES {
public enum NODE_STATES {
DELETED, STARTED, STOPPED, H_SCALED, V_SCALED, CONFIGURED, RUNNING, FAILED
}
......
......@@ -15,63 +15,36 @@
*/
package nl.uva.sne.drip.commons.utils;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import org.json.JSONException;
import org.json.JSONObject;
import org.springframework.web.multipart.MultipartFile;
import org.yaml.snakeyaml.Yaml;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.security.InvalidKeyException;
import java.security.Key;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
import java.util.Base64;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.*;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import java.util.zip.ZipOutputStream;
import javax.crypto.BadPaddingException;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.spec.SecretKeySpec;
import nl.uva.sne.drip.model.tosca.Credential;
import org.json.JSONException;
import org.json.JSONObject;
import org.springframework.web.multipart.MultipartFile;
import org.yaml.snakeyaml.Yaml;
/**
*
* @author S. Koulouzis
*/
public class Converter {
public static String map2YmlString(Map<String, Object> map) throws JSONException {
JSONObject jsonObject = new JSONObject(map);
String yamlStr = json2Yml2(jsonObject.toString());
return yamlStr;
return json2Yml2(jsonObject.toString());
}
public static String json2Yml2(String jsonString) throws JSONException {
Yaml yaml = new Yaml();
String yamlStr = yaml.dump(ymlString2Map(jsonString));
return yamlStr;
return yaml.dump(ymlString2Map(jsonString));
}
public static Map<String, Object> ymlString2Map(String yamlString) {
......@@ -118,15 +91,15 @@ public class Converter {
return new String(encodedBytes, StandardCharsets.UTF_8);
}
public static void zipFolder(String sourceFolder, String zipFolder) throws FileNotFoundException, IOException {
public static void zipFolder(String sourceFolder, String zipFolder) throws IOException {
try (FileOutputStream fos = new FileOutputStream(zipFolder);
ZipOutputStream zos = new ZipOutputStream(fos)) {
ZipOutputStream zos = new ZipOutputStream(fos)) {
Path sourcePath = Paths.get(sourceFolder);
Files.walkFileTree(sourcePath, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult preVisitDirectory(final Path dir, final BasicFileAttributes attrs) throws IOException {
if (!sourcePath.equals(dir)) {
zos.putNextEntry(new ZipEntry(sourcePath.relativize(dir).toString() + "/"));
zos.putNextEntry(new ZipEntry(sourcePath.relativize(dir) + "/"));
zos.closeEntry();
}
return FileVisitResult.CONTINUE;
......@@ -168,62 +141,4 @@ public class Converter {
}
}
public static String decryptString(String contents, String secret) throws UnsupportedEncodingException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException {
SecretKeySpec secretKey = getsecretKey(secret);
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5PADDING");
cipher.init(Cipher.DECRYPT_MODE, secretKey);
return new String(cipher.doFinal(Base64.getDecoder().decode(contents)));
}
public static String encryptString(String contents, String secret) throws UnsupportedEncodingException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException {
SecretKeySpec secretKey = getsecretKey(secret);
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, secretKey);
return Base64.getEncoder().encodeToString(cipher.doFinal(contents.getBytes("UTF-8")));
}
private static SecretKeySpec getsecretKey(String myKey) throws UnsupportedEncodingException, NoSuchAlgorithmException {
MessageDigest sha;
byte[] key = myKey.getBytes("UTF-8");
sha = MessageDigest.getInstance("SHA-1");
key = sha.digest(key);
key = Arrays.copyOf(key, 16);
return new SecretKeySpec(key, "AES");
}
public static Credential encryptCredential(Credential credential, String credentialSecret) throws UnsupportedEncodingException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException {
Map<String, String> credKeys = credential.getKeys();
Set<String> keySet = credKeys.keySet();
for (String key : keySet) {
String credKey = credKeys.get(key);
if (credKey != null) {
credKeys.put(key, encryptString(credKey, credentialSecret));
}
}
String token = credential.getToken();
if (token != null) {
credential.setToken(encryptString(token, credentialSecret));
}
return credential;
}
public static Credential dencryptCredential(Credential credential, String credentialSecret) throws UnsupportedEncodingException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException {
Map<String, String> credKeys = credential.getKeys();
Set<String> keySet = credKeys.keySet();
for (String key : keySet) {
String credKey = credKeys.get(key);
if (credKey != null) {
credKeys.put(key, decryptString(credKey, credentialSecret));
}
}
String token = credential.getToken();
if (token != null) {
credential.setToken(decryptString(token, credentialSecret));
}
return credential;
}
}
......@@ -24,33 +24,30 @@ import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.KeyPair;
import java.io.File;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.Base64;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import nl.uva.sne.drip.model.Exceptions.TypeExeption;
import nl.uva.sne.drip.model.NodeTemplate;
import nl.uva.sne.drip.model.NodeTemplateMap;
import nl.uva.sne.drip.model.cloud.storm.CloudsStormSubTopology.StatusEnum;
import nl.uva.sne.drip.model.cloud.storm.OpCode;
import nl.uva.sne.drip.model.tosca.Credential;
import nl.uva.sne.drip.model.tosca.ToscaTemplate;
import nl.uva.sne.drip.sure.tosca.client.DefaultApi;
import org.apache.commons.io.FileUtils;
import nl.uva.sne.drip.sure.tosca.client.ApiException;
import nl.uva.sne.drip.sure.tosca.client.Configuration;
import nl.uva.sne.drip.sure.tosca.client.DefaultApi;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Autowired;
import java.io.File;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import static nl.uva.sne.drip.commons.utils.Constants.*;
import nl.uva.sne.drip.model.cloud.storm.CloudsStormSubTopology.StatusEnum;
import nl.uva.sne.drip.model.cloud.storm.OpCode;
/**
*
* @author S. Koulouzis
*/
public class ToscaHelper {
......@@ -79,6 +76,58 @@ public class ToscaHelper {
return true;
}
public static NODE_STATES cloudStormStatus2NodeState(StatusEnum cloudStormStatus) {
if (cloudStormStatus.equals(StatusEnum.FRESH)) {
return null;
}
String cloudStormStatusStr = cloudStormStatus.toString().toUpperCase();
return NODE_STATES.valueOf(cloudStormStatusStr);
}
public static OpCode.OperationEnum NodeDesiredState2CloudStormOperation(NODE_STATES nodeDesiredState) {
switch (nodeDesiredState) {
case RUNNING:
return OpCode.OperationEnum.PROVISION;
case DELETED:
return OpCode.OperationEnum.DELETE;
case STARTED:
return OpCode.OperationEnum.START;
case STOPPED:
return OpCode.OperationEnum.STOP;
case H_SCALED:
return OpCode.OperationEnum.HSCALE;
case V_SCALED:
return OpCode.OperationEnum.VSCALE;
default:
return null;
}
}
public static StatusEnum nodeCurrentState2CloudStormStatus(NODE_STATES currentState) {
if (currentState == null) {
return StatusEnum.FRESH;
}
switch (currentState) {
case RUNNING:
return StatusEnum.RUNNING;
case DELETED:
return StatusEnum.DELETED;
case STARTED:
return StatusEnum.RUNNING;
case STOPPED:
return StatusEnum.STOPPED;
case H_SCALED:
return StatusEnum.RUNNING;
case V_SCALED:
return StatusEnum.RUNNING;
case FAILED:
return StatusEnum.FAILED;
default:
return null;
}
}
/**
* @return the id
*/
......@@ -97,7 +146,7 @@ public class ToscaHelper {
}
public void uploadToscaTemplate(ToscaTemplate toscaTemplate) throws JsonProcessingException, IOException, ApiException {
public void uploadToscaTemplate(ToscaTemplate toscaTemplate) throws IOException, ApiException {
String ymlStr = objectMapper.writeValueAsString(toscaTemplate);
File toscaTemplateFile = File.createTempFile("temp-toscaTemplate", ".yml");
FileUtils.writeByteArrayToFile(toscaTemplateFile, ymlStr.getBytes());
......@@ -334,14 +383,6 @@ public class ToscaHelper {
return node;
}
public static NODE_STATES cloudStormStatus2NodeState(StatusEnum cloudStormStatus) {
if (cloudStormStatus.equals(StatusEnum.FRESH)) {
return null;
}
String cloudStormStatusStr = cloudStormStatus.toString().toUpperCase();
return NODE_STATES.valueOf(cloudStormStatusStr);
}
public KeyPair getKeyPairsFromVM(NodeTemplate vmMap) throws ApiException, TypeExeption, JSchException {
if (vmMap.getType().equals(VM_TYPE)) {
Map<String, Object> attributes = vmMap.getAttributes();
......@@ -364,50 +405,6 @@ public class ToscaHelper {
return null;
}
public static OpCode.OperationEnum NodeDesiredState2CloudStormOperation(NODE_STATES nodeDesiredState) {
switch (nodeDesiredState) {
case RUNNING:
return OpCode.OperationEnum.PROVISION;
case DELETED:
return OpCode.OperationEnum.DELETE;
case STARTED:
return OpCode.OperationEnum.START;
case STOPPED:
return OpCode.OperationEnum.STOP;
case H_SCALED:
return OpCode.OperationEnum.HSCALE;
case V_SCALED:
return OpCode.OperationEnum.VSCALE;
default:
return null;
}
}
public static StatusEnum nodeCurrentState2CloudStormStatus(NODE_STATES currentState) {
if (currentState == null) {
return StatusEnum.FRESH;
}
switch (currentState) {
case RUNNING:
return StatusEnum.RUNNING;
case DELETED:
return StatusEnum.DELETED;
case STARTED:
return StatusEnum.RUNNING;
case STOPPED:
return StatusEnum.STOPPED;
case H_SCALED:
return StatusEnum.RUNNING;
case V_SCALED:
return StatusEnum.RUNNING;
case FAILED:
return StatusEnum.FAILED;
default:
return null;
}
}
public Map<String, Object> getNodeArtifacts(NodeTemplate nodeTemplate) {
return nodeTemplate.getArtifacts();
}
......
......@@ -16,14 +16,13 @@
package nl.uva.sne.drip.model.Exceptions;
/**
*
* @author S. Koulouzis
*/
public class MissingCredentialsException extends Exception{
public class MissingCredentialsException extends Exception {
public MissingCredentialsException(String string) {
super(string);
}
}
......@@ -16,7 +16,6 @@
package nl.uva.sne.drip.model.Exceptions;
/**
*
* @author S. Koulouzis
*/
public class MissingVMTopologyException extends Exception {
......
......@@ -16,13 +16,12 @@
package nl.uva.sne.drip.model.Exceptions;
/**
*
* @author S. Koulouzis
*/
public class TypeExeption extends Exception{
public class TypeExeption extends Exception {
public TypeExeption(String string) {
super(string);
}
}
......@@ -16,22 +16,27 @@
package nl.uva.sne.drip.model;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import nl.uva.sne.drip.model.tosca.ToscaTemplate;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.io.Serializable;
import java.util.List;
import nl.uva.sne.drip.model.tosca.ToscaTemplate;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
*
*
*
* @author S. Koulouzis.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
public class Message implements Serializable {
@NotNull
private String owner;
@NotNull
private Long creationDate;
// private List<MessageParameter> parameters;
private ToscaTemplate toscaTemplate;
private Exception exception;
/**
* @return the exception
*/
......@@ -46,17 +51,6 @@ public class Message implements Serializable {
this.exception = exception;
}
@NotNull
private String owner;
@NotNull
private Long creationDate;
// private List<MessageParameter> parameters;
private ToscaTemplate toscaTemplate;
private Exception exception;
public Long getCreationDate() {
return this.creationDate;
}
......
......@@ -16,27 +16,26 @@
package nl.uva.sne.drip.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.io.Serializable;
import java.util.Map;
/**
*
* @author S. Koulouzis.
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public class MessageParameter implements Serializable {
private String url;
private String encoding;
private String value;
private String name;
private Map<String, String> attributes;
public static final String NAME = "name";
public static final String URL = "url";
public static final String VALUE = "value";
public static final String ENCODING = "encoding";
public static final String TOSCA_TEMPLATE = "tosca_template";
private String url;
private String encoding;
private String value;
private String name;
private Map<String, String> attributes;
public String getURL() {
return this.url;
......@@ -54,14 +53,14 @@ public class MessageParameter implements Serializable {
this.encoding = encoding;
}
public void setName(String name) {
this.name = name;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getValue() {
return this.value;
}
......
package nl.uva.sne.drip.model;
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.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import javax.validation.constraints.*;
import java.util.*;
/**
* NodeTemplate
......@@ -68,7 +62,6 @@ public class NodeTemplate {
* Get derivedFrom
*
* @return derivedFrom
*
*/
@ApiModelProperty(value = "")
......@@ -97,7 +90,6 @@ public class NodeTemplate {
* Get properties
*
* @return properties
*
*/
@ApiModelProperty(value = "")
......@@ -126,7 +118,6 @@ public class NodeTemplate {
* Get requirements
*
* @return requirements
*
*/
@ApiModelProperty(value = "")
......@@ -157,7 +148,6 @@ public class NodeTemplate {
* Get interfaces
*
* @return interfaces
*
*/
@ApiModelProperty(value = "")
......@@ -186,7 +176,6 @@ public class NodeTemplate {
* Get capabilities
*
* @return capabilities
*
*/
@ApiModelProperty(value = "")
......@@ -207,7 +196,6 @@ public class NodeTemplate {
* Get type
*
* @return type
*
*/
@ApiModelProperty(value = "")
......@@ -228,7 +216,6 @@ public class NodeTemplate {
* Get description
*
* @return description
*
*/
@ApiModelProperty(value = "")
......@@ -257,7 +244,6 @@ public class NodeTemplate {
* Get directives
*
* @return directives
*
*/
@ApiModelProperty(value = "")
......@@ -286,7 +272,6 @@ public class NodeTemplate {
* Get attributes
*
* @return attributes
*
*/
@ApiModelProperty(value = "")
......@@ -315,7 +300,6 @@ public class NodeTemplate {
* Get artifacts
*
* @return artifacts
*
*/
@ApiModelProperty(value = "")
......
/*
* tosca-sure
* TOSCA Simple qUeRy sErvice (SURE).
* TOSCA Simple qUeRy sErvice (SURE).
*
* OpenAPI spec version: 1.0.0
* Contact: S.Koulouzis@uva.nl
......@@ -11,10 +11,11 @@
*/
package nl.uva.sne.drip.model;
import java.util.Objects;
import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModelProperty;
import java.util.Objects;
/**
* NodeTemplateMap
*/
......@@ -36,7 +37,6 @@ public class NodeTemplateMap {
* Get name
*
* @return name
*
*/
@ApiModelProperty(value = "")
public String getName() {
......@@ -56,7 +56,6 @@ public class NodeTemplateMap {
* Get nodeTemplate
*
* @return nodeTemplate
*
*/
@ApiModelProperty(value = "")
public NodeTemplate getNodeTemplate() {
......
package nl.uva.sne.drip.model;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.validation.annotation.Validated;
import java.util.Objects;
/**
* Provisioner
*/
......@@ -34,7 +35,6 @@ public class Provisioner {
* Get name
*
* @return name
*
*/
@ApiModelProperty(value = "")
......@@ -55,7 +55,6 @@ public class Provisioner {
* Get version
*
* @return version
*
*/
@ApiModelProperty(value = "")
......@@ -76,7 +75,6 @@ public class Provisioner {
* Get description
*
* @return description
*
*/
@ApiModelProperty(value = "")
......@@ -97,7 +95,6 @@ public class Provisioner {
* Get toscaInterfaceType
*
* @return toscaInterfaceType
*
*/
@ApiModelProperty(value = "")
......
package nl.uva.sne.drip.model;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.validation.annotation.Validated;
import org.springframework.data.annotation.Id;
import org.springframework.validation.annotation.Validated;
import java.util.Objects;
/**
* User
......@@ -46,7 +47,6 @@ public class User {
* Get id
*
* @return id
*
*/
@ApiModelProperty(value = "")
......@@ -67,7 +67,6 @@ public class User {
* Get username
*
* @return username
*
*/
@ApiModelProperty(value = "")
......@@ -88,7 +87,6 @@ public class User {
* Get firstName
*
* @return firstName
*
*/
@ApiModelProperty(value = "")
......@@ -109,7 +107,6 @@ public class User {
* Get lastName
*
* @return lastName
*
*/
@ApiModelProperty(value = "")
......@@ -130,7 +127,6 @@ public class User {
* Get email
*
* @return email
*
*/
@ApiModelProperty(value = "")
......@@ -151,7 +147,6 @@ public class User {
* Get password
*
* @return password
*
*/
@ApiModelProperty(value = "")
......@@ -172,7 +167,6 @@ public class User {
* User Status
*
* @return userStatus
*
*/
@ApiModelProperty(value = "User Status")
......
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;
import java.util.Objects;
/**
* CloudCred
*/
......@@ -28,7 +29,6 @@ public class CloudCred {
* Get cloudProvider
*
* @return cloudProvider
*
*/
@ApiModelProperty(value = "")
......@@ -49,7 +49,6 @@ public class CloudCred {
* Get credInfoFile
*
* @return credInfoFile
*
*/
@ApiModelProperty(value = "")
......
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;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* CloudCredentialDB
......@@ -37,7 +38,6 @@ public class CloudCredentialDB {
* Get cloudCreds
*
* @return cloudCreds
*
*/
@ApiModelProperty(value = "")
......
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.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.validation.annotation.Validated;
import java.util.Objects;
/**
* CloudDB
*/
......@@ -15,40 +16,8 @@ import org.springframework.validation.annotation.Validated;
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 CloudProviderEnum cloudProvider = null;
@JsonProperty("dbInfoFile")
private String dbInfoFile = null;
......@@ -61,7 +30,6 @@ public class CloudDB {
* Get cloudProvider
*
* @return cloudProvider
*
*/
@ApiModelProperty(value = "")
......@@ -82,7 +50,6 @@ public class CloudDB {
* Get dbInfoFile
*
* @return dbInfoFile
*
*/
@ApiModelProperty(value = "")
......@@ -133,4 +100,35 @@ public class CloudDB {
}
return o.toString().replace("\n", "\n ");
}
/**
* Gets or Sets cloudProvider
*/
public enum CloudProviderEnum {
EC2("EC2"),
EXOGENI("ExoGENI"),
EGI("EGI");
private String value;
CloudProviderEnum(String value) {
this.value = value;
}
@JsonCreator
public static CloudProviderEnum fromValue(String text) {
for (CloudProviderEnum b : CloudProviderEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
}
}
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.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import java.util.*;
/**
* CloudStormDCMetaInfo
......@@ -53,7 +50,6 @@ public class CloudStormDCMetaInfo {
* Get domain
*
* @return domain
*
*/
@ApiModelProperty(value = "")
......@@ -74,7 +70,6 @@ public class CloudStormDCMetaInfo {
* Get endpoint
*
* @return endpoint
*
*/
@ApiModelProperty(value = "")
......@@ -95,7 +90,6 @@ public class CloudStormDCMetaInfo {
* Get country
*
* @return country
*
*/
@ApiModelProperty(value = "")
......@@ -116,7 +110,6 @@ public class CloudStormDCMetaInfo {
* Get longitude
*
* @return longitude
*
*/
@ApiModelProperty(value = "")
......@@ -137,7 +130,6 @@ public class CloudStormDCMetaInfo {
* Get latitude
*
* @return latitude
*
*/
@ApiModelProperty(value = "")
......@@ -158,7 +150,6 @@ public class CloudStormDCMetaInfo {
* Get availability
*
* @return availability
*
*/
@ApiModelProperty(value = "")
......@@ -187,7 +178,6 @@ public class CloudStormDCMetaInfo {
* Get vmMetaInfo
*
* @return vmMetaInfo
*
*/
@ApiModelProperty(value = "")
......@@ -218,7 +208,6 @@ public class CloudStormDCMetaInfo {
* Get extraInfo
*
* @return extraInfo
*
*/
@ApiModelProperty(value = "")
......
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.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* CloudsStormInfrasCode
......@@ -18,39 +19,8 @@ import javax.validation.Valid;
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 ModeEnum mode = null;
@JsonProperty("InfrasCodes")
@Valid
private List<InfrasCode> infrasCodes = null;
......@@ -64,7 +34,6 @@ public class CloudsStormInfrasCode {
* Get mode
*
* @return mode
*
*/
@ApiModelProperty(value = "")
......@@ -93,7 +62,6 @@ public class CloudsStormInfrasCode {
* Get infrasCodes
*
* @return infrasCodes
*
*/
@ApiModelProperty(value = "")
......@@ -146,4 +114,34 @@ public class CloudsStormInfrasCode {
}
return o.toString().replace("\n", "\n ");
}
/**
* Gets or Sets mode
*/
public enum ModeEnum {
LOCAL("LOCAL"),
CTRL("CTRL");
private String value;
ModeEnum(String value) {
this.value = value;
}
@JsonCreator
public static ModeEnum fromValue(String text) {
for (ModeEnum b : ModeEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
}
}
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.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import javax.validation.constraints.*;
import java.util.Objects;
/**
* CloudsStormSubMembers
......@@ -16,92 +13,94 @@ import javax.validation.constraints.*;
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-11T15:13:55.016Z")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CloudsStormSubMembers {
@JsonProperty("vmName")
private String vmName = null;
public class CloudsStormSubMembers {
@JsonProperty("vmName")
private String vmName = null;
@JsonProperty("address")
private String address = null;
@JsonProperty("address")
private String address = null;
public CloudsStormSubMembers vmName(String vmName) {
this.vmName = vmName;
return this;
}
public CloudsStormSubMembers vmName(String vmName) {
this.vmName = vmName;
return this;
}
/**
* Get vmName
*
* @return vmName
**/
@ApiModelProperty(value = "")
/**
* Get vmName
* @return vmName
**/
@ApiModelProperty(value = "")
public String getVmName() {
return vmName;
}
public String getVmName() {
return vmName;
}
public void setVmName(String vmName) {
this.vmName = vmName;
}
public void setVmName(String vmName) {
this.vmName = vmName;
}
public CloudsStormSubMembers address(String address) {
this.address = address;
return this;
}
public CloudsStormSubMembers address(String address) {
this.address = address;
return this;
}
/**
* Get address
*
* @return address
**/
@ApiModelProperty(value = "")
/**
* Get address
* @return address
**/
@ApiModelProperty(value = "")
public String getAddress() {
return address;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public void setAddress(String address) {
this.address = address;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CloudsStormSubMembers cloudsStormSubMembers = (CloudsStormSubMembers) o;
return Objects.equals(this.vmName, cloudsStormSubMembers.vmName) &&
Objects.equals(this.address, cloudsStormSubMembers.address);
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
@Override
public int hashCode() {
return Objects.hash(vmName, address);
}
if (o == null || getClass() != o.getClass()) {
return false;
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CloudsStormSubMembers {\n");
sb.append(" vmName: ").append(toIndentedString(vmName)).append("\n");
sb.append(" address: ").append(toIndentedString(address)).append("\n");
sb.append("}");
return sb.toString();
}
CloudsStormSubMembers cloudsStormSubMembers = (CloudsStormSubMembers) o;
return Objects.equals(this.vmName, cloudsStormSubMembers.vmName) &&
Objects.equals(this.address, cloudsStormSubMembers.address);
}
@Override
public int hashCode() {
return Objects.hash(vmName, address);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CloudsStormSubMembers {\n");
sb.append(" vmName: ").append(toIndentedString(vmName)).append("\n");
sb.append(" address: ").append(toIndentedString(address)).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";
/**
* 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 ");
}
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 com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModelProperty;
import java.util.HashMap;
import java.util.Map;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
* CloudsStormSubTopology
......@@ -26,53 +27,15 @@ public class CloudsStormSubTopology {
@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("status")
private StatusEnum status = null;
@JsonProperty("logsInfo")
@Valid
private Map<String, Object> logsInfo = null;
@JsonProperty("subTopologyClass")
private String subTopologyClass = null;
@JsonProperty("sshKeyPairId")
private String sshKeyPairId = null;
@JsonProperty("scaledFrom")
@Valid
private Map<String, Object> scaledFrom = null;
......@@ -81,11 +44,11 @@ public class CloudsStormSubTopology {
this.topology = topology;
return this;
}
/**
* Get topology
*
* @return topology
*
*/
@ApiModelProperty(value = "")
......@@ -106,7 +69,6 @@ public class CloudsStormSubTopology {
* Get cloudProvider
*
* @return cloudProvider
*
*/
@ApiModelProperty(value = "")
......@@ -127,7 +89,6 @@ public class CloudsStormSubTopology {
* Get domain
*
* @return domain
*
*/
@ApiModelProperty(value = "")
......@@ -148,7 +109,6 @@ public class CloudsStormSubTopology {
* Get status
*
* @return status
*
*/
@ApiModelProperty(value = "")
......@@ -177,7 +137,6 @@ public class CloudsStormSubTopology {
* Get logsInfo
*
* @return logsInfo
*
*/
@ApiModelProperty(value = "")
......@@ -198,7 +157,6 @@ public class CloudsStormSubTopology {
* Get subTopologyClass
*
* @return subTopologyClass
*
*/
@ApiModelProperty(value = "")
......@@ -219,7 +177,6 @@ public class CloudsStormSubTopology {
* Get sshKeyPairId
*
* @return sshKeyPairId
*
*/
@ApiModelProperty(value = "")
......@@ -248,7 +205,6 @@ public class CloudsStormSubTopology {
* Get scaledFrom
*
* @return scaledFrom
*
*/
@ApiModelProperty(value = "")
......@@ -311,4 +267,37 @@ public class CloudsStormSubTopology {
}
return o.toString().replace("\n", "\n ");
}
/**
* 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;
}
@JsonCreator
public static StatusEnum fromValue(String text) {
for (StatusEnum b : StatusEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
}
}
package nl.uva.sne.drip.model.cloud.storm;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonInclude;
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;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* CloudsStormSubnets
......@@ -15,152 +16,156 @@ import javax.validation.Valid;
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-11T15:13:55.016Z")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CloudsStormSubnets {
@JsonProperty("name")
private String name = null;
public class CloudsStormSubnets {
@JsonProperty("name")
private String name = null;
@JsonProperty("subnet")
private String subnet = null;
@JsonProperty("netmask")
private String netmask = null;
@JsonProperty("members")
@Valid
private List<CloudsStormSubMembers> members = null;
public CloudsStormSubnets name(String name) {
this.name = name;
return this;
}
/**
* Get name
*
* @return name
**/
@ApiModelProperty(value = "")
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public CloudsStormSubnets subnet(String subnet) {
this.subnet = subnet;
return this;
}
/**
* Get subnet
*
* @return subnet
**/
@ApiModelProperty(value = "")
@JsonProperty("subnet")
private String subnet = null;
public String getSubnet() {
return subnet;
}
public void setSubnet(String subnet) {
this.subnet = subnet;
}
public CloudsStormSubnets netmask(String netmask) {
this.netmask = netmask;
return this;
}
/**
* Get netmask
*
* @return netmask
**/
@ApiModelProperty(value = "")
public String getNetmask() {
return netmask;
}
public void setNetmask(String netmask) {
this.netmask = netmask;
}
public CloudsStormSubnets members(List<CloudsStormSubMembers> members) {
this.members = members;
return this;
}
public CloudsStormSubnets addMembersItem(CloudsStormSubMembers membersItem) {
if (this.members == null) {
this.members = new ArrayList<CloudsStormSubMembers>();
}
this.members.add(membersItem);
return this;
}
/**
* Get members
*
* @return members
**/
@ApiModelProperty(value = "")
@Valid
public List<CloudsStormSubMembers> getMembers() {
return members;
}
@JsonProperty("netmask")
private String netmask = null;
public void setMembers(List<CloudsStormSubMembers> members) {
this.members = members;
}
@JsonProperty("members")
@Valid
private List<CloudsStormSubMembers> members = null;
public CloudsStormSubnets name(String name) {
this.name = name;
return this;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CloudsStormSubnets cloudsStormSubnets = (CloudsStormSubnets) o;
return Objects.equals(this.name, cloudsStormSubnets.name) &&
Objects.equals(this.subnet, cloudsStormSubnets.subnet) &&
Objects.equals(this.netmask, cloudsStormSubnets.netmask) &&
Objects.equals(this.members, cloudsStormSubnets.members);
}
/**
* Get name
* @return name
**/
@ApiModelProperty(value = "")
@Override
public int hashCode() {
return Objects.hash(name, subnet, netmask, members);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CloudsStormSubnets {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" subnet: ").append(toIndentedString(subnet)).append("\n");
sb.append(" netmask: ").append(toIndentedString(netmask)).append("\n");
sb.append(" members: ").append(toIndentedString(members)).append("\n");
sb.append("}");
return sb.toString();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public CloudsStormSubnets subnet(String subnet) {
this.subnet = subnet;
return this;
}
/**
* Get subnet
* @return subnet
**/
@ApiModelProperty(value = "")
public String getSubnet() {
return subnet;
}
public void setSubnet(String subnet) {
this.subnet = subnet;
}
public CloudsStormSubnets netmask(String netmask) {
this.netmask = netmask;
return this;
}
/**
* Get netmask
* @return netmask
**/
@ApiModelProperty(value = "")
public String getNetmask() {
return netmask;
}
public void setNetmask(String netmask) {
this.netmask = netmask;
}
public CloudsStormSubnets members(List<CloudsStormSubMembers> members) {
this.members = members;
return this;
}
public CloudsStormSubnets addMembersItem(CloudsStormSubMembers membersItem) {
if (this.members == null) {
this.members = new ArrayList<CloudsStormSubMembers>();
}
this.members.add(membersItem);
return this;
}
/**
* Get members
* @return members
**/
@ApiModelProperty(value = "")
@Valid
public List<CloudsStormSubMembers> getMembers() {
return members;
}
public void setMembers(List<CloudsStormSubMembers> members) {
this.members = members;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CloudsStormSubnets cloudsStormSubnets = (CloudsStormSubnets) o;
return Objects.equals(this.name, cloudsStormSubnets.name) &&
Objects.equals(this.subnet, cloudsStormSubnets.subnet) &&
Objects.equals(this.netmask, cloudsStormSubnets.netmask) &&
Objects.equals(this.members, cloudsStormSubnets.members);
}
@Override
public int hashCode() {
return Objects.hash(name, subnet, netmask, members);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CloudsStormSubnets {\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" subnet: ").append(toIndentedString(subnet)).append("\n");
sb.append(" netmask: ").append(toIndentedString(netmask)).append("\n");
sb.append(" members: ").append(toIndentedString(members)).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 ");
}
/**
* 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 com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import nl.uva.sne.drip.model.cloud.storm.CloudsStormSubTopology;
import nl.uva.sne.drip.model.cloud.storm.CloudsStormSubnets;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import javax.validation.constraints.*;
import java.util.Objects;
/**
* CloudsStormTopTopology
......@@ -23,37 +19,34 @@ import javax.validation.constraints.*;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class CloudsStormTopTopology {
/**
* @return the connections
*/
public Map<String, Object> getConnections() {
return connections;
}
/**
* @param connections the connections to set
*/
public void setConnections(Map<String, Object> connections) {
this.connections = connections;
}
@JsonProperty("userName")
private String userName = null;
@JsonProperty("publicKeyPath")
private String publicKeyPath = null;
@JsonProperty("topologies")
@Valid
private List<CloudsStormSubTopology> topologies = null;
@JsonProperty("subnets")
@Valid
private List<CloudsStormSubnets> subnets = null;
@JsonProperty("connections")
@Valid
private Map<String, Object> connections = null;
/**
* @return the connections
*/
public Map<String, Object> getConnections() {
return connections;
}
/**
* @param connections the connections to set
*/
public void setConnections(Map<String, Object> connections) {
this.connections = connections;
}
public CloudsStormTopTopology userName(String userName) {
this.userName = userName;
return this;
......@@ -63,7 +56,6 @@ public class CloudsStormTopTopology {
* Get userName
*
* @return userName
*
*/
@ApiModelProperty(value = "")
......@@ -84,7 +76,6 @@ public class CloudsStormTopTopology {
* Get publicKeyPath
*
* @return publicKeyPath
*
*/
@ApiModelProperty(value = "")
......@@ -113,7 +104,6 @@ public class CloudsStormTopTopology {
* Get topologies
*
* @return topologies
*
*/
@ApiModelProperty(value = "")
......@@ -144,7 +134,6 @@ public class CloudsStormTopTopology {
* Get subnets
*
* @return subnets
*
*/
@ApiModelProperty(value = "")
......
package nl.uva.sne.drip.model.cloud.storm;
import com.fasterxml.jackson.annotation.JsonAlias;
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;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
* CloudsStormVM
......@@ -17,6 +18,73 @@ import javax.validation.Valid;
public class CloudsStormVM {
@JsonProperty("name")
private String name = null;
@JsonProperty("nodeType")
@JsonAlias({"type"})
private String nodeType = null;
@JsonProperty("VEngineClass")
private String VEngineClass = null;
@JsonProperty("OStype")
@JsonAlias({"os", "OS"})
private String ostype = null;
@JsonProperty("script")
private String script = null;
@JsonProperty("publicAddress")
private String publicAddress = null;
@JsonProperty("extraInfo")
@Valid
private Map<String, Object> extraInfo = null;
@JsonProperty("CPU")
@JsonAlias({"cpu"})
private String CPU = null;
@JsonProperty("MEM")
@JsonAlias({"Mem"})
private String MEM = null;
@JsonProperty("VMType")
@JsonAlias({"type"})
private String vmType = null;
@JsonProperty("Price")
private String price = null;
@JsonProperty("DefaultSSHAccount")
@JsonAlias({"defaultSSHAccount"})
private String defaultSSHAccount = null;
@JsonProperty("availability")
private String availability = null;
@JsonProperty("selfEthAddresses")
private String selfEthAddresses = null;
@JsonProperty("VEngineClass")
private String vEngineClass = null;
@JsonProperty("VNFType")
private String vNFType = null;
@JsonProperty("scaledFrom")
private String scaledFrom = null;
@JsonProperty("fake")
private String fake = null;
@JsonProperty("OS_URL")
private String OS_URL = null;
@JsonProperty("OS_GUID")
private String OS_GUID = null;
@JsonProperty("diskSize")
@JsonAlias({"DiskSize"})
private Integer diskSize;
@JsonProperty("IOPS")
private Integer iOPS;
@JsonProperty("vpcId")
private String vpcId;
@JsonProperty("subnetId")
private String subnetId;
@JsonProperty("securityGroupId")
private String securityGroupId;
@JsonProperty("instanceId")
private String instanceId;
@JsonProperty("volumeId")
private Object volumeId;
@JsonProperty("routeTableId")
private String routeTableId;
@JsonProperty("internetGatewayId")
private String internetGatewayId;
/**
* @return the iOPS
*/
......@@ -255,77 +323,6 @@ public class CloudsStormVM {
this.selfEthAddresses = selfEthAddresses;
}
@JsonProperty("name")
private String name = null;
@JsonProperty("nodeType")
@JsonAlias({"type"})
private String nodeType = null;
@JsonProperty("VEngineClass")
private String VEngineClass = null;
@JsonProperty("OStype")
@JsonAlias({"os", "OS"})
private String ostype = null;
@JsonProperty("script")
private String script = null;
@JsonProperty("publicAddress")
private String publicAddress = null;
@JsonProperty("extraInfo")
@Valid
private Map<String, Object> extraInfo = null;
@JsonProperty("CPU")
@JsonAlias({"cpu"})
private String CPU = null;
@JsonProperty("MEM")
@JsonAlias({"Mem"})
private String MEM = null;
@JsonProperty("VMType")
@JsonAlias({"type"})
private String vmType = null;
@JsonProperty("Price")
private String price = null;
@JsonProperty("DefaultSSHAccount")
@JsonAlias({"defaultSSHAccount"})
private String defaultSSHAccount = null;
@JsonProperty("availability")
private String availability = null;
@JsonProperty("selfEthAddresses")
private String selfEthAddresses = null;
@JsonProperty("VEngineClass")
private String vEngineClass = null;
@JsonProperty("VNFType")
private String vNFType = null;
@JsonProperty("scaledFrom")
private String scaledFrom = null;
@JsonProperty("fake")
private String fake = null;
@JsonProperty("OS_URL")
private String OS_URL = null;
@JsonProperty("OS_GUID")
private String OS_GUID = null;
@JsonProperty("diskSize")
@JsonAlias({"DiskSize"})
private Integer diskSize;
public CloudsStormVM name(String name) {
this.name = name;
return this;
......@@ -335,7 +332,6 @@ public class CloudsStormVM {
* Get name
*
* @return name
*
*/
@ApiModelProperty(value = "")
......@@ -356,7 +352,6 @@ public class CloudsStormVM {
* Get nodeType
*
* @return nodeType
*
*/
@ApiModelProperty(value = "")
......@@ -377,7 +372,6 @@ public class CloudsStormVM {
* Get ostype
*
* @return ostype
*
*/
@ApiModelProperty(value = "")
......@@ -398,7 +392,6 @@ public class CloudsStormVM {
* Get script
*
* @return script
*
*/
@ApiModelProperty(value = "")
......@@ -419,7 +412,6 @@ public class CloudsStormVM {
* Get publicAddress
*
* @return publicAddress
*
*/
@ApiModelProperty(value = "")
......@@ -431,7 +423,7 @@ public class CloudsStormVM {
this.publicAddress = publicAddress;
}
// public CloudsStormVM type(String type) {
// public CloudsStormVM type(String type) {
// this.type = type;
// return this;
// }
......@@ -468,7 +460,6 @@ public class CloudsStormVM {
* Get extraInfo
*
* @return extraInfo
*
*/
@ApiModelProperty(value = "")
......@@ -480,7 +471,7 @@ public class CloudsStormVM {
this.extraInfo = extraInfo;
}
// public CloudsStormVM OS(String OS) {
// public CloudsStormVM OS(String OS) {
// this.OS = OS;
// return this;
// }
......@@ -509,7 +500,6 @@ public class CloudsStormVM {
* Get CPU
*
* @return CPU
*
*/
@ApiModelProperty(value = "")
......@@ -530,7 +520,6 @@ public class CloudsStormVM {
* Get MEM
*
* @return MEM
*
*/
@ApiModelProperty(value = "")
......@@ -551,7 +540,6 @@ public class CloudsStormVM {
* Get vmType
*
* @return vmType
*
*/
@ApiModelProperty(value = "")
......@@ -572,7 +560,6 @@ public class CloudsStormVM {
* Get price
*
* @return price
*
*/
@ApiModelProperty(value = "")
......@@ -593,7 +580,6 @@ public class CloudsStormVM {
* Get defaultSSHAccount
*
* @return defaultSSHAccount
*
*/
@ApiModelProperty(value = "")
......@@ -614,7 +600,6 @@ public class CloudsStormVM {
* Get availability
*
* @return availability
*
*/
@ApiModelProperty(value = "")
......@@ -690,21 +675,4 @@ public class CloudsStormVM {
return o.toString().replace("\n", "\n ");
}
@JsonProperty("IOPS")
private Integer iOPS;
@JsonProperty("vpcId")
private String vpcId;
@JsonProperty("subnetId")
private String subnetId;
@JsonProperty("securityGroupId")
private String securityGroupId;
@JsonProperty("instanceId")
private String instanceId;
@JsonProperty("volumeId")
private Object volumeId;
@JsonProperty("routeTableId")
private String routeTableId;
@JsonProperty("internetGatewayId")
private String internetGatewayId;
}
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;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import java.util.Objects;
/**
* CloudsStormVMs
......@@ -17,6 +18,25 @@ import javax.validation.Valid;
public class CloudsStormVMs {
@JsonProperty("extraInfo")
@Valid
private Map<String, Object> extraInfo = null;
@JsonProperty("VMs")
@Valid
private List<CloudsStormVM> vms = null;
@JsonProperty("WhetherCreateVPC")
@Valid
private Boolean whetherCreateVPC;
@JsonProperty("SEngineClass")
@Valid
private String sEngineClass = null;
@JsonProperty("sliceName")
@Valid
private String sliceName = null;
@JsonProperty("duration")
@Valid
private Float duration = null;
/**
* @return the whetherCreateVPC
*/
......@@ -80,10 +100,6 @@ public class CloudsStormVMs {
return sEngineClass;
}
@JsonProperty("extraInfo")
@Valid
private Map<String, Object> extraInfo = null;
/**
* @param sEngineClass the sEngineClass to set
*/
......@@ -91,26 +107,6 @@ public class CloudsStormVMs {
this.sEngineClass = sEngineClass;
}
@JsonProperty("VMs")
@Valid
private List<CloudsStormVM> vms = null;
@JsonProperty("WhetherCreateVPC")
@Valid
private Boolean whetherCreateVPC;
@JsonProperty("SEngineClass")
@Valid
private String sEngineClass = null;
@JsonProperty("sliceName")
@Valid
private String sliceName = null;
@JsonProperty("duration")
@Valid
private Float duration = null;
public CloudsStormVMs vms(List<CloudsStormVM> vms) {
this.vms = vms;
return this;
......@@ -128,7 +124,6 @@ public class CloudsStormVMs {
* Get vms
*
* @return vms
*
*/
@ApiModelProperty(value = "")
......
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;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
* Credential
......@@ -44,7 +45,6 @@ public class Credential {
* The optional protocol name. e.g. http,xauth,oauth2,ssh
*
* @return protocol
*
*/
@ApiModelProperty(value = "The optional protocol name. e.g. http,xauth,oauth2,ssh")
......@@ -66,7 +66,6 @@ public class Credential {
* bearer, identifier
*
* @return tokenType
*
*/
@ApiModelProperty(value = "The required token type. default: password. e.g. basic_auth,X-Auth-Token, bearer, identifier")
......@@ -89,7 +88,6 @@ public class Credential {
* 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")
......@@ -118,7 +116,6 @@ public class Credential {
* The optional list of protocol-specific keys or assertions.
*
* @return keys
*
*/
@ApiModelProperty(value = "The optional list of protocol-specific keys or assertions.")
......@@ -139,7 +136,6 @@ public class Credential {
* 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.")
......@@ -160,7 +156,6 @@ public class Credential {
* The cloud provider name e.g. ec2.
*
* @return cloudProviderName
*
*/
@ApiModelProperty(value = "The cloud provider name e.g. ec2.")
......
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;
import java.util.Objects;
/**
* CredentialInfo
*/
......@@ -43,7 +44,6 @@ public class CredentialInfo {
* Get userKeyName
*
* @return userKeyName
*
*/
@ApiModelProperty(value = "")
......@@ -64,7 +64,6 @@ public class CredentialInfo {
* Get keyAlias
*
* @return keyAlias
*
*/
@ApiModelProperty(value = "")
......@@ -85,7 +84,6 @@ public class CredentialInfo {
* Get keyPassword
*
* @return keyPassword
*
*/
@ApiModelProperty(value = "")
......@@ -106,7 +104,6 @@ public class CredentialInfo {
* Get proxyFileName
*
* @return proxyFileName
*
*/
@ApiModelProperty(value = "")
......@@ -127,7 +124,6 @@ public class CredentialInfo {
* Get trustedCertDirName
*
* @return trustedCertDirName
*
*/
@ApiModelProperty(value = "")
......@@ -148,7 +144,6 @@ public class CredentialInfo {
* Get accessKey
*
* @return accessKey
*
*/
@ApiModelProperty(value = "")
......@@ -169,7 +164,6 @@ public class CredentialInfo {
* Get secretKey
*
* @return secretKey
*
*/
@ApiModelProperty(value = "")
......
package nl.uva.sne.drip.model.cloud.storm;
import com.fasterxml.jackson.annotation.JsonInclude;
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;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* DB
......@@ -38,7 +39,6 @@ public class DB {
* Get cloudDBs
*
* @return cloudDBs
*
*/
@ApiModelProperty(value = "")
......
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;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* DBInfo
......@@ -32,7 +33,6 @@ public class DBInfo {
* Get globalEntry
*
* @return globalEntry
*
*/
@ApiModelProperty(value = "")
......@@ -61,7 +61,6 @@ public class DBInfo {
* Get dcMetaInfo
*
* @return dcMetaInfo
*
*/
@ApiModelProperty(value = "")
......
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.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import java.util.Objects;
/**
* InfrasCode
......@@ -18,59 +17,26 @@ import javax.validation.Valid;
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 CodeTypeEnum 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(CodeTypeEnum codeType) {
this.codeType = codeType;
return this;
}
// @JsonProperty("OpCodes")
// @Valid
// private List<OpCode> opCodes = null;
/**
* Get codeType
*
* @return codeType
*
*/
@ApiModelProperty(value = "")
......@@ -91,7 +57,6 @@ public class InfrasCode {
* Get opCode
*
* @return opCode
*
*/
@ApiModelProperty(value = "")
......@@ -114,7 +79,6 @@ public class InfrasCode {
* Get count
*
* @return count
*
*/
@ApiModelProperty(value = "")
......@@ -126,6 +90,21 @@ public class InfrasCode {
this.count = count;
}
@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);
}
// public InfrasCode opCodes(List<OpCode> opCodes) {
// this.opCodes = opCodes;
// return this;
......@@ -157,21 +136,6 @@ public class InfrasCode {
// 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);
......@@ -200,4 +164,34 @@ public class InfrasCode {
}
return o.toString().replace("\n", "\n ");
}
/**
* Gets or Sets codeType
*/
public enum CodeTypeEnum {
SEQ("SEQ"),
LOOP("LOOP");
private String value;
CodeTypeEnum(String value) {
this.value = value;
}
@JsonCreator
public static CodeTypeEnum fromValue(String text) {
for (CodeTypeEnum b : CodeTypeEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
}
}
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.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import java.util.Objects;
/**
* OpCode
......@@ -16,90 +17,16 @@ import javax.validation.Valid;
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"),
STOP("stop");
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 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;
@JsonProperty("Command")
private String command = null;
@JsonProperty("Log")
private Boolean log = null;
@JsonProperty("Options")
private Options options = null;
......@@ -112,7 +39,6 @@ public class OpCode {
* Get operation
*
* @return operation
*
*/
@ApiModelProperty(value = "")
......@@ -133,7 +59,6 @@ public class OpCode {
* Get objectType
*
* @return objectType
*
*/
@ApiModelProperty(value = "")
......@@ -154,7 +79,6 @@ public class OpCode {
* Get objects
*
* @return objects
*
*/
@ApiModelProperty(value = "")
......@@ -175,7 +99,6 @@ public class OpCode {
* Get command
*
* @return command
*
*/
@ApiModelProperty(value = "")
......@@ -196,7 +119,6 @@ public class OpCode {
* Get log
*
* @return log
*
*/
@ApiModelProperty(value = "")
......@@ -217,7 +139,6 @@ public class OpCode {
* Get options
*
* @return options
*
*/
@ApiModelProperty(value = "")
......@@ -278,4 +199,73 @@ public class OpCode {
}
return o.toString().replace("\n", "\n ");
}
/**
* 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"),
STOP("stop");
private String value;
OperationEnum(String value) {
this.value = value;
}
@JsonCreator
public static OperationEnum fromValue(String text) {
for (OperationEnum b : OperationEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
}
/**
* Gets or Sets objectType
*/
public enum ObjectTypeEnum {
SUBTOPOLOGY("SubTopology"),
VM("VM"),
REQ("REQ");
private String value;
ObjectTypeEnum(String value) {
this.value = value;
}
@JsonCreator
public static ObjectTypeEnum fromValue(String text) {
for (ObjectTypeEnum b : ObjectTypeEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
@Override
@JsonValue
public String toString() {
return String.valueOf(value);
}
}
}
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;
import java.util.Objects;
/**
* Options
*/
......@@ -28,7 +29,6 @@ public class Options {
* Get src
*
* @return src
*
*/
@ApiModelProperty(value = "")
......@@ -49,7 +49,6 @@ public class Options {
* Get dst
*
* @return dst
*
*/
@ApiModelProperty(value = "")
......
package nl.uva.sne.drip.model.tosca;
import com.fasterxml.jackson.annotation.JsonIgnore;
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.data.annotation.Id;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import org.springframework.data.annotation.Id;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
/**
* Credential
......@@ -16,44 +17,37 @@ import org.springframework.data.annotation.Id;
@Validated
@javax.annotation.Generated(value = "io.swagger.codegen.languages.SpringCodegen", date = "2019-12-10T15:39:04.296Z")
public class Credential {
/**
* @return the id
*/
public String getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(String id) {
this.id = id;
}
@Id
@JsonIgnore
private String id;
@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;
/**
* @return the id
*/
public String getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(String id) {
this.id = id;
}
public Credential protocol(String protocol) {
this.protocol = protocol;
return this;
......@@ -63,7 +57,6 @@ public class Credential {
* Get protocol
*
* @return protocol
*
*/
@ApiModelProperty(value = "")
......@@ -84,7 +77,6 @@ public class Credential {
* Get tokenType
*
* @return tokenType
*
*/
@ApiModelProperty(value = "")
......@@ -105,7 +97,6 @@ public class Credential {
* Get token
*
* @return token
*
*/
@ApiModelProperty(value = "")
......@@ -134,7 +125,6 @@ public class Credential {
* Get keys
*
* @return keys
*
*/
@ApiModelProperty(value = "")
......@@ -155,7 +145,6 @@ public class Credential {
* Get user
*
* @return user
*
*/
@ApiModelProperty(value = "")
......@@ -176,7 +165,6 @@ public class Credential {
* Get cloudProviderName
*
* @return cloudProviderName
*
*/
@ApiModelProperty(value = "")
......
package nl.uva.sne.drip.model.tosca;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import nl.uva.sne.drip.model.NodeTemplate;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import nl.uva.sne.drip.model.NodeTemplate;
import java.util.*;
/**
* TopologyTemplate
......@@ -59,7 +56,6 @@ public class TopologyTemplate {
* Get description
*
* @return description
*
*/
@ApiModelProperty(value = "")
......@@ -88,7 +84,6 @@ public class TopologyTemplate {
* Get inputs
*
* @return inputs
*
*/
@ApiModelProperty(value = "")
......@@ -117,7 +112,6 @@ public class TopologyTemplate {
* Get nodeTemplates
*
* @return nodeTemplates
*
*/
@ApiModelProperty(value = "")
......@@ -148,7 +142,6 @@ public class TopologyTemplate {
* Get relationshipTemplates
*
* @return relationshipTemplates
*
*/
@ApiModelProperty(value = "")
......@@ -177,7 +170,6 @@ public class TopologyTemplate {
* Get outputs
*
* @return outputs
*
*/
@ApiModelProperty(value = "")
......@@ -206,7 +198,6 @@ public class TopologyTemplate {
* Get groups
*
* @return groups
*
*/
@ApiModelProperty(value = "")
......@@ -235,7 +226,6 @@ public class TopologyTemplate {
* Get substitutionMappings
*
* @return substitutionMappings
*
*/
@ApiModelProperty(value = "")
......@@ -264,7 +254,6 @@ public class TopologyTemplate {
* Get policies
*
* @return policies
*
*/
@ApiModelProperty(value = "")
......
package nl.uva.sne.drip.model.tosca;
import com.fasterxml.jackson.annotation.JsonIgnore;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.data.annotation.Id;
import org.springframework.validation.annotation.Validated;
import javax.validation.Valid;
import org.springframework.data.annotation.Id;
import java.util.*;
/**
* ToscaTemplate
......@@ -20,90 +17,71 @@ import org.springframework.data.annotation.Id;
public class ToscaTemplate {
public String getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(String id) {
this.id = id;
}
@Id
@JsonIgnore
private String id;
@JsonProperty("tosca_definitions_version")
private String toscaDefinitionsVersion = null;
@JsonProperty("tosca_default_namespace")
private String toscaDefaultNamespace = null;
@JsonProperty("template_name")
private String templateName = null;
@JsonProperty("topology_template")
private TopologyTemplate topologyTemplate = null;
@JsonProperty("template_author")
private String templateAuthor = null;
@JsonProperty("template_version")
private String templateVersion = null;
@JsonProperty("description")
private String description = null;
@JsonProperty("imports")
@Valid
private List<Map<String, Object>> imports = null;
@JsonProperty("dsl_definitions")
@Valid
private Map<String, Object> dslDefinitions = null;
@JsonProperty("node_types")
@Valid
private Map<String, Object> nodeTypes = null;
@JsonProperty("relationship_types")
@Valid
private Map<String, Object> relationshipTypes = null;
@JsonProperty("relationship_templates")
@Valid
private Map<String, Object> relationshipTemplates = null;
@JsonProperty("capability_types")
@Valid
private Map<String, Object> capabilityTypes = null;
@JsonProperty("artifact_types")
@Valid
private Map<String, Object> artifactTypes = null;
@JsonProperty("data_types")
@Valid
private Map<String, Object> dataTypes = null;
@JsonProperty("interface_types")
@Valid
private Map<String, Object> interfaceTypes = null;
@JsonProperty("policy_types")
@Valid
private Map<String, Object> policyTypes = null;
@JsonProperty("group_types")
@Valid
private Map<String, Object> groupTypes = null;
@JsonProperty("repositories")
@Valid
private Map<String, Object> repositories = null;
public String getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(String id) {
this.id = id;
}
public ToscaTemplate toscaDefinitionsVersion(String toscaDefinitionsVersion) {
this.toscaDefinitionsVersion = toscaDefinitionsVersion;
return this;
......@@ -113,7 +91,6 @@ public class ToscaTemplate {
* Get toscaDefinitionsVersion
*
* @return toscaDefinitionsVersion
*
*/
@ApiModelProperty(value = "")
......@@ -134,7 +111,6 @@ public class ToscaTemplate {
* Get toscaDefaultNamespace
*
* @return toscaDefaultNamespace
*
*/
@ApiModelProperty(value = "")
......@@ -155,7 +131,6 @@ public class ToscaTemplate {
* Get templateName
*
* @return templateName
*
*/
@ApiModelProperty(value = "")
......@@ -176,7 +151,6 @@ public class ToscaTemplate {
* Get topologyTemplate
*
* @return topologyTemplate
*
*/
@ApiModelProperty(value = "")
......@@ -199,7 +173,6 @@ public class ToscaTemplate {
* Get templateAuthor
*
* @return templateAuthor
*
*/
@ApiModelProperty(value = "")
......@@ -220,7 +193,6 @@ public class ToscaTemplate {
* Get templateVersion
*
* @return templateVersion
*
*/
@ApiModelProperty(value = "")
......@@ -241,7 +213,6 @@ public class ToscaTemplate {
* Get description
*
* @return description
*
*/
@ApiModelProperty(value = "")
......@@ -270,7 +241,6 @@ public class ToscaTemplate {
* Get imports
*
* @return imports
*
*/
@ApiModelProperty(value = "")
......@@ -301,7 +271,6 @@ public class ToscaTemplate {
* Get dslDefinitions
*
* @return dslDefinitions
*
*/
@ApiModelProperty(value = "")
......@@ -330,7 +299,6 @@ public class ToscaTemplate {
* Get nodeTypes
*
* @return nodeTypes
*
*/
@ApiModelProperty(value = "")
......@@ -359,7 +327,6 @@ public class ToscaTemplate {
* Get relationshipTypes
*
* @return relationshipTypes
*
*/
@ApiModelProperty(value = "")
......@@ -388,7 +355,6 @@ public class ToscaTemplate {
* Get relationshipTemplates
*
* @return relationshipTemplates
*
*/
@ApiModelProperty(value = "")
......@@ -417,7 +383,6 @@ public class ToscaTemplate {
* Get capabilityTypes
*
* @return capabilityTypes
*
*/
@ApiModelProperty(value = "")
......@@ -446,7 +411,6 @@ public class ToscaTemplate {
* Get artifactTypes
*
* @return artifactTypes
*
*/
@ApiModelProperty(value = "")
......@@ -475,7 +439,6 @@ public class ToscaTemplate {
* Get dataTypes
*
* @return dataTypes
*
*/
@ApiModelProperty(value = "")
......@@ -504,7 +467,6 @@ public class ToscaTemplate {
* Get interfaceTypes
*
* @return interfaceTypes
*
*/
@ApiModelProperty(value = "")
......@@ -533,7 +495,6 @@ public class ToscaTemplate {
* Get policyTypes
*
* @return policyTypes
*
*/
@ApiModelProperty(value = "")
......@@ -562,7 +523,6 @@ public class ToscaTemplate {
* Get groupTypes
*
* @return groupTypes
*
*/
@ApiModelProperty(value = "")
......@@ -591,7 +551,6 @@ public class ToscaTemplate {
* Get repositories
*
* @return repositories
*
*/
@ApiModelProperty(value = "")
......
/*
* tosca-sure
* TOSCA Simple qUeRy sErvice (SURE).
* TOSCA Simple qUeRy sErvice (SURE).
*
* OpenAPI spec version: 1.0.0
* Contact: S.Koulouzis@uva.nl
......@@ -14,63 +14,63 @@
package nl.uva.sne.drip.sure.tosca.auth;
import nl.uva.sne.drip.sure.tosca.client.Pair;
import java.util.Map;
import java.util.List;
import nl.uva.sne.drip.sure.tosca.client.Pair;
import java.util.Map;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-12-20T15:53:11.510Z")
public class ApiKeyAuth implements Authentication {
private final String location;
private final String paramName;
private final String location;
private final String paramName;
private String apiKey;
private String apiKeyPrefix;
private String apiKey;
private String apiKeyPrefix;
public ApiKeyAuth(String location, String paramName) {
this.location = location;
this.paramName = paramName;
}
public String getLocation() {
return location;
}
public String getParamName() {
return paramName;
}
public ApiKeyAuth(String location, String paramName) {
this.location = location;
this.paramName = paramName;
}
public String getApiKey() {
return apiKey;
}
public String getLocation() {
return location;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
public String getParamName() {
return paramName;
}
public String getApiKeyPrefix() {
return apiKeyPrefix;
}
public String getApiKey() {
return apiKey;
}
public void setApiKeyPrefix(String apiKeyPrefix) {
this.apiKeyPrefix = apiKeyPrefix;
}
public void setApiKey(String apiKey) {
this.apiKey = apiKey;
}
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {
if (apiKey == null) {
return;
public String getApiKeyPrefix() {
return apiKeyPrefix;
}
String value;
if (apiKeyPrefix != null) {
value = apiKeyPrefix + " " + apiKey;
} else {
value = apiKey;
public void setApiKeyPrefix(String apiKeyPrefix) {
this.apiKeyPrefix = apiKeyPrefix;
}
if ("query".equals(location)) {
queryParams.add(new Pair(paramName, value));
} else if ("header".equals(location)) {
headerParams.put(paramName, value);
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {
if (apiKey == null) {
return;
}
String value;
if (apiKeyPrefix != null) {
value = apiKeyPrefix + " " + apiKey;
} else {
value = apiKey;
}
if ("query".equals(location)) {
queryParams.add(new Pair(paramName, value));
} else if ("header".equals(location)) {
headerParams.put(paramName, value);
}
}
}
}
/*
* tosca-sure
* TOSCA Simple qUeRy sErvice (SURE).
* TOSCA Simple qUeRy sErvice (SURE).
*
* OpenAPI spec version: 1.0.0
* Contact: S.Koulouzis@uva.nl
......@@ -14,16 +14,16 @@
package nl.uva.sne.drip.sure.tosca.auth;
import nl.uva.sne.drip.sure.tosca.client.Pair;
import java.util.Map;
import java.util.List;
import nl.uva.sne.drip.sure.tosca.client.Pair;
import java.util.Map;
public interface Authentication {
/**
* Apply authentication settings to header and query params.
*
* @param queryParams List of query parameters
* @param queryParams List of query parameters
* @param headerParams Map of header parameters
*/
void applyToParams(List<Pair> queryParams, Map<String, String> headerParams);
......
/*
* tosca-sure
* TOSCA Simple qUeRy sErvice (SURE).
* TOSCA Simple qUeRy sErvice (SURE).
*
* OpenAPI spec version: 1.0.0
* Contact: S.Koulouzis@uva.nl
......@@ -14,14 +14,11 @@
package nl.uva.sne.drip.sure.tosca.auth;
import com.squareup.okhttp.Credentials;
import nl.uva.sne.drip.sure.tosca.client.Pair;
import java.util.Map;
import java.util.List;
import java.io.UnsupportedEncodingException;
import nl.uva.sne.drip.sure.tosca.client.Pair;
import java.util.Map;
public class HttpBasicAuth implements Authentication {
private String username;
......@@ -49,7 +46,7 @@ public class HttpBasicAuth implements Authentication {
return;
}
headerParams.put("Authorization", Credentials.basic(
username == null ? "" : username,
password == null ? "" : password));
username == null ? "" : username,
password == null ? "" : password));
}
}
/*
* tosca-sure
* TOSCA Simple qUeRy sErvice (SURE).
* TOSCA Simple qUeRy sErvice (SURE).
*
* OpenAPI spec version: 1.0.0
* Contact: S.Koulouzis@uva.nl
......@@ -14,27 +14,27 @@
package nl.uva.sne.drip.sure.tosca.auth;
import nl.uva.sne.drip.sure.tosca.client.Pair;
import java.util.Map;
import java.util.List;
import nl.uva.sne.drip.sure.tosca.client.Pair;
import java.util.Map;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-12-20T15:53:11.510Z")
public class OAuth implements Authentication {
private String accessToken;
private String accessToken;
public String getAccessToken() {
return accessToken;
}
public String getAccessToken() {
return accessToken;
}
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
public void setAccessToken(String accessToken) {
this.accessToken = accessToken;
}
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {
if (accessToken != null) {
headerParams.put("Authorization", "Bearer " + accessToken);
@Override
public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams) {
if (accessToken != null) {
headerParams.put("Authorization", "Bearer " + accessToken);
}
}
}
}
/*
* tosca-sure
* TOSCA Simple qUeRy sErvice (SURE).
* TOSCA Simple qUeRy sErvice (SURE).
*
* OpenAPI spec version: 1.0.0
* Contact: S.Koulouzis@uva.nl
......
/*
* tosca-sure
* TOSCA Simple qUeRy sErvice (SURE).
* TOSCA Simple qUeRy sErvice (SURE).
*
* OpenAPI spec version: 1.0.0
* Contact: S.Koulouzis@uva.nl
......@@ -12,8 +12,8 @@
package nl.uva.sne.drip.sure.tosca.client;
import java.util.Map;
import java.util.List;
import java.util.Map;
/**
* Callback for asynchronous API call.
......@@ -25,19 +25,19 @@ public interface ApiCallback<T> {
/**
* This is called when the API call fails.
*
* @param e The exception causing the failure
* @param statusCode Status code of the response if available, otherwise it
* would be 0
* @param e The exception causing the failure
* @param statusCode Status code of the response if available, otherwise it
* would be 0
* @param responseHeaders Headers of the response if available, otherwise it
* would be null
* would be null
*/
void onFailure(ApiException e, int statusCode, Map<String, List<String>> responseHeaders);
/**
* This is called when the API call succeeded.
*
* @param result The result deserialized from response
* @param statusCode Status code of the response
* @param result The result deserialized from response
* @param statusCode Status code of the response
* @param responseHeaders Headers of the response
*/
void onSuccess(T result, int statusCode, Map<String, List<String>> responseHeaders);
......@@ -45,18 +45,18 @@ public interface ApiCallback<T> {
/**
* This is called when the API upload processing.
*
* @param bytesWritten bytes Written
* @param bytesWritten bytes Written
* @param contentLength content length of request body
* @param done write end
* @param done write end
*/
void onUploadProgress(long bytesWritten, long contentLength, boolean done);
/**
* This is called when the API downlond processing.
*
* @param bytesRead bytes Read
* @param bytesRead bytes Read
* @param contentLength content lenngth of the response
* @param done Read end
* @param done Read end
*/
void onDownloadProgress(long bytesRead, long contentLength, boolean done);
}
/*
* tosca-sure
* TOSCA Simple qUeRy sErvice (SURE).
* TOSCA Simple qUeRy sErvice (SURE).
*
* OpenAPI spec version: 1.0.0
* Contact: S.Koulouzis@uva.nl
......@@ -11,8 +11,8 @@
*/
package nl.uva.sne.drip.sure.tosca.client;
import java.util.Map;
import java.util.List;
import java.util.Map;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-12-28T19:11:27.492Z")
public class ApiException extends Exception {
......
/*
* tosca-sure
* TOSCA Simple qUeRy sErvice (SURE).
* TOSCA Simple qUeRy sErvice (SURE).
*
* OpenAPI spec version: 1.0.0
* Contact: S.Koulouzis@uva.nl
......@@ -27,7 +27,7 @@ public class ApiResponse<T> {
/**
* @param statusCode The status code of HTTP response
* @param headers The headers of HTTP response
* @param headers The headers of HTTP response
*/
public ApiResponse(int statusCode, Map<String, List<String>> headers) {
this(statusCode, headers, null);
......@@ -35,8 +35,8 @@ public class ApiResponse<T> {
/**
* @param statusCode The status code of HTTP response
* @param headers The headers of HTTP response
* @param data The object deserialized from response bod
* @param headers The headers of HTTP response
* @param data The object deserialized from response bod
*/
public ApiResponse(int statusCode, Map<String, List<String>> headers, T data) {
this.statusCode = statusCode;
......
/*
* tosca-sure
* TOSCA Simple qUeRy sErvice (SURE).
* TOSCA Simple qUeRy sErvice (SURE).
*
* OpenAPI spec version: 1.0.0
* Contact: S.Koulouzis@uva.nl
......
/*
* tosca-sure
* TOSCA Simple qUeRy sErvice (SURE).
* TOSCA Simple qUeRy sErvice (SURE).
*
* OpenAPI spec version: 1.0.0
* Contact: S.Koulouzis@uva.nl
......@@ -23,20 +23,21 @@ import java.io.IOException;
/**
* Encodes request bodies using gzip.
*
* <p>
* Taken from https://github.com/square/okhttp/issues/350
*/
class GzipRequestInterceptor implements Interceptor {
@Override public Response intercept(Chain chain) throws IOException {
@Override
public Response intercept(Chain chain) throws IOException {
Request originalRequest = chain.request();
if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) {
return chain.proceed(originalRequest);
}
Request compressedRequest = originalRequest.newBuilder()
.header("Content-Encoding", "gzip")
.method(originalRequest.method(), forceContentLength(gzip(originalRequest.body())))
.build();
.header("Content-Encoding", "gzip")
.method(originalRequest.method(), forceContentLength(gzip(originalRequest.body())))
.build();
return chain.proceed(compressedRequest);
}
......@@ -63,15 +64,18 @@ class GzipRequestInterceptor implements Interceptor {
private RequestBody gzip(final RequestBody body) {
return new RequestBody() {
@Override public MediaType contentType() {
@Override
public MediaType contentType() {
return body.contentType();
}
@Override public long contentLength() {
@Override
public long contentLength() {
return -1; // We don't know the compressed length in advance!
}
@Override public void writeTo(BufferedSink sink) throws IOException {
@Override
public void writeTo(BufferedSink sink) throws IOException {
BufferedSink gzipSink = Okio.buffer(new GzipSink(sink));
body.writeTo(gzipSink);
gzipSink.close();
......
/*
* tosca-sure
* TOSCA Simple qUeRy sErvice (SURE).
* TOSCA Simple qUeRy sErvice (SURE).
*
* OpenAPI spec version: 1.0.0
* Contact: S.Koulouzis@uva.nl
......@@ -13,21 +13,16 @@
package nl.uva.sne.drip.sure.tosca.client;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonParseException;
import com.google.gson.TypeAdapter;
import com.google.gson.*;
import com.google.gson.internal.bind.util.ISO8601Utils;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.google.gson.JsonElement;
import io.gsonfire.GsonFireBuilder;
import okio.ByteString;
import org.threeten.bp.LocalDate;
import org.threeten.bp.OffsetDateTime;
import org.threeten.bp.format.DateTimeFormatter;
import okio.ByteString;
import java.io.IOException;
import java.io.StringReader;
import java.lang.reflect.Type;
......@@ -40,22 +35,30 @@ import java.util.Map;
public class JSON {
private Gson gson;
private boolean isLenientOnJson = false;
private DateTypeAdapter dateTypeAdapter = new DateTypeAdapter();
private SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter();
private OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter();
private LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
private ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter();
private final DateTypeAdapter dateTypeAdapter = new DateTypeAdapter();
private final SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter();
private final OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter();
private final LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
public JSON() {
ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter();
gson = createGson()
.registerTypeAdapter(Date.class, dateTypeAdapter)
.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter)
.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter)
.registerTypeAdapter(LocalDate.class, localDateTypeAdapter)
.registerTypeAdapter(byte[].class, byteArrayAdapter)
.create();
}
public static GsonBuilder createGson() {
GsonFireBuilder fireBuilder = new GsonFireBuilder()
;
GsonBuilder builder = fireBuilder.createGsonBuilder();
return builder;
GsonFireBuilder fireBuilder = new GsonFireBuilder();
return fireBuilder.createGsonBuilder();
}
private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) {
JsonElement element = readElement.getAsJsonObject().get(discriminatorField);
if(null == element) {
if (null == element) {
throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">");
}
return element.getAsString();
......@@ -63,22 +66,12 @@ public class JSON {
private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) {
Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue.toUpperCase());
if(null == clazz) {
if (null == clazz) {
throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">");
}
return clazz;
}
public JSON() {
gson = createGson()
.registerTypeAdapter(Date.class, dateTypeAdapter)
.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter)
.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter)
.registerTypeAdapter(LocalDate.class, localDateTypeAdapter)
.registerTypeAdapter(byte[].class, byteArrayAdapter)
.create();
}
/**
* Get Gson.
*
......@@ -142,32 +135,24 @@ public class JSON {
}
}
/**
* Gson TypeAdapter for Byte Array type
*/
public class ByteArrayAdapter extends TypeAdapter<byte[]> {
public JSON setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
offsetDateTimeTypeAdapter.setFormat(dateFormat);
return this;
}
@Override
public void write(JsonWriter out, byte[] value) throws IOException {
if (value == null) {
out.nullValue();
} else {
out.value(ByteString.of(value).base64());
}
}
public JSON setLocalDateFormat(DateTimeFormatter dateFormat) {
localDateTypeAdapter.setFormat(dateFormat);
return this;
}
@Override
public byte[] read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String bytesAsBase64 = in.nextString();
ByteString byteString = ByteString.decodeBase64(bytesAsBase64);
return byteString.toByteArray();
}
}
public JSON setDateFormat(DateFormat dateFormat) {
dateTypeAdapter.setFormat(dateFormat);
return this;
}
public JSON setSqlDateFormat(DateFormat dateFormat) {
sqlDateTypeAdapter.setFormat(dateFormat);
return this;
}
/**
......@@ -207,64 +192,13 @@ public class JSON {
default:
String date = in.nextString();
if (date.endsWith("+0000")) {
date = date.substring(0, date.length()-5) + "Z";
date = date.substring(0, date.length() - 5) + "Z";
}
return OffsetDateTime.parse(date, formatter);
}
}
}
/**
* Gson TypeAdapter for JSR310 LocalDate type
*/
public class LocalDateTypeAdapter extends TypeAdapter<LocalDate> {
private DateTimeFormatter formatter;
public LocalDateTypeAdapter() {
this(DateTimeFormatter.ISO_LOCAL_DATE);
}
public LocalDateTypeAdapter(DateTimeFormatter formatter) {
this.formatter = formatter;
}
public void setFormat(DateTimeFormatter dateFormat) {
this.formatter = dateFormat;
}
@Override
public void write(JsonWriter out, LocalDate date) throws IOException {
if (date == null) {
out.nullValue();
} else {
out.value(formatter.format(date));
}
}
@Override
public LocalDate read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
return LocalDate.parse(date, formatter);
}
}
}
public JSON setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
offsetDateTimeTypeAdapter.setFormat(dateFormat);
return this;
}
public JSON setLocalDateFormat(DateTimeFormatter dateFormat) {
localDateTypeAdapter.setFormat(dateFormat);
return this;
}
/**
* Gson TypeAdapter for java.sql.Date type
* If the dateFormat is null, a simple "yyyy-MM-dd" format will be used
......@@ -378,14 +312,73 @@ public class JSON {
}
}
public JSON setDateFormat(DateFormat dateFormat) {
dateTypeAdapter.setFormat(dateFormat);
return this;
/**
* Gson TypeAdapter for Byte Array type
*/
public class ByteArrayAdapter extends TypeAdapter<byte[]> {
@Override
public void write(JsonWriter out, byte[] value) throws IOException {
if (value == null) {
out.nullValue();
} else {
out.value(ByteString.of(value).base64());
}
}
@Override
public byte[] read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String bytesAsBase64 = in.nextString();
ByteString byteString = ByteString.decodeBase64(bytesAsBase64);
return byteString.toByteArray();
}
}
}
public JSON setSqlDateFormat(DateFormat dateFormat) {
sqlDateTypeAdapter.setFormat(dateFormat);
return this;
/**
* Gson TypeAdapter for JSR310 LocalDate type
*/
public class LocalDateTypeAdapter extends TypeAdapter<LocalDate> {
private DateTimeFormatter formatter;
public LocalDateTypeAdapter() {
this(DateTimeFormatter.ISO_LOCAL_DATE);
}
public LocalDateTypeAdapter(DateTimeFormatter formatter) {
this.formatter = formatter;
}
public void setFormat(DateTimeFormatter dateFormat) {
this.formatter = dateFormat;
}
@Override
public void write(JsonWriter out, LocalDate date) throws IOException {
if (date == null) {
out.nullValue();
} else {
out.value(formatter.format(date));
}
}
@Override
public LocalDate read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
return LocalDate.parse(date, formatter);
}
}
}
}
/*
* tosca-sure
* TOSCA Simple qUeRy sErvice (SURE).
* TOSCA Simple qUeRy sErvice (SURE).
*
* OpenAPI spec version: 1.0.0
* Contact: S.Koulouzis@uva.nl
......@@ -18,31 +18,31 @@ public class Pair {
private String name = "";
private String value = "";
public Pair (String name, String value) {
public Pair(String name, String value) {
setName(name);
setValue(value);
}
public String getName() {
return this.name;
}
private void setName(String name) {
if (!isValidString(name)) return;
this.name = name;
}
public String getValue() {
return this.value;
}
private void setValue(String value) {
if (!isValidString(value)) return;
this.value = value;
}
public String getName() {
return this.name;
}
public String getValue() {
return this.value;
}
private boolean isValidString(String arg) {
if (arg == null) return false;
if (arg.trim().isEmpty()) return false;
......
/*
* tosca-sure
* TOSCA Simple qUeRy sErvice (SURE).
* TOSCA Simple qUeRy sErvice (SURE).
*
* OpenAPI spec version: 1.0.0
* Contact: S.Koulouzis@uva.nl
......@@ -15,23 +15,13 @@ package nl.uva.sne.drip.sure.tosca.client;
import com.squareup.okhttp.MediaType;
import com.squareup.okhttp.RequestBody;
import okio.*;
import java.io.IOException;
import okio.Buffer;
import okio.BufferedSink;
import okio.ForwardingSink;
import okio.Okio;
import okio.Sink;
public class ProgressRequestBody extends RequestBody {
public interface ProgressRequestListener {
void onRequestProgress(long bytesWritten, long contentLength, boolean done);
}
private final RequestBody requestBody;
private final ProgressRequestListener progressListener;
public ProgressRequestBody(RequestBody requestBody, ProgressRequestListener progressListener) {
......@@ -74,4 +64,8 @@ public class ProgressRequestBody extends RequestBody {
}
};
}
public interface ProgressRequestListener {
void onRequestProgress(long bytesWritten, long contentLength, boolean done);
}
}
/*
* tosca-sure
* TOSCA Simple qUeRy sErvice (SURE).
* TOSCA Simple qUeRy sErvice (SURE).
*
* OpenAPI spec version: 1.0.0
* Contact: S.Koulouzis@uva.nl
......@@ -15,25 +15,15 @@ package nl.uva.sne.drip.sure.tosca.client;
import com.squareup.okhttp.MediaType;
import com.squareup.okhttp.ResponseBody;
import okio.*;
import java.io.IOException;
import okio.Buffer;
import okio.BufferedSource;
import okio.ForwardingSource;
import okio.Okio;
import okio.Source;
public class ProgressResponseBody extends ResponseBody {
public interface ProgressListener {
void update(long bytesRead, long contentLength, boolean done);
}
private final ResponseBody responseBody;
private final ProgressListener progressListener;
private BufferedSource bufferedSource;
public ProgressResponseBody(ResponseBody responseBody, ProgressListener progressListener) {
this.responseBody = responseBody;
this.progressListener = progressListener;
......@@ -71,6 +61,10 @@ public class ProgressResponseBody extends ResponseBody {
}
};
}
public interface ProgressListener {
void update(long bytesRead, long contentLength, boolean done);
}
}
/*
* tosca-sure
* TOSCA Simple qUeRy sErvice (SURE).
* TOSCA Simple qUeRy sErvice (SURE).
*
* OpenAPI spec version: 1.0.0
* Contact: S.Koulouzis@uva.nl
......@@ -15,41 +15,41 @@ package nl.uva.sne.drip.sure.tosca.client;
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2019-12-28T19:11:27.492Z")
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).
*
* @param array The array
* @param value The value to search
* @return true if the array contains the value
*/
public static boolean containsIgnoreCase(String[] array, String value) {
for (String str : array) {
if (value == null && str == null) return true;
if (value != null && value.equalsIgnoreCase(str)) return true;
/**
* Check if the given array contains the given value (with case-insensitive comparison).
*
* @param array The array
* @param value The value to search
* @return true if the array contains the value
*/
public static boolean containsIgnoreCase(String[] array, String value) {
for (String str : array) {
if (value == null && str == null) return true;
if (value != null && value.equalsIgnoreCase(str)) return true;
}
return false;
}
return false;
}
/**
* Join an array of strings with the given separator.
* <p>
* Note: This might be replaced by utility method from commons-lang or guava someday
* if one of those libraries is added as dependency.
* </p>
*
* @param array The array of strings
* @param separator The separator
* @return the resulting string
*/
public static String join(String[] array, String separator) {
int len = array.length;
if (len == 0) return "";
/**
* Join an array of strings with the given separator.
* <p>
* Note: This might be replaced by utility method from commons-lang or guava someday
* if one of those libraries is added as dependency.
* </p>
*
* @param array The array of strings
* @param separator The separator
* @return the resulting string
*/
public static String join(String[] array, String separator) {
int len = array.length;
if (len == 0) return "";
StringBuilder out = new StringBuilder();
out.append(array[0]);
for (int i = 1; i < len; i++) {
out.append(separator).append(array[i]);
StringBuilder out = new StringBuilder();
out.append(array[0]);
for (int i = 1; i < len; i++) {
out.append(separator).append(array[i]);
}
return out.toString();
}
return out.toString();
}
}
......@@ -28,7 +28,4 @@ RUN pip3 install --no-cache-dir -r requirements.txt
COPY . /usr/src/app
CMD sed -i "s#http://127.0.0.1:8081/tosca-sure/1.0.0#$SURE_TOSCA_BASE_PATH#g" properties.ini && \
sed -i "s#http://127.0.0.1:3000/api#$SEMAPHORE_BASE_PATH#g" properties.ini && \
sed -i "s#host = 127.0.0.1#host = $RABBITMQ_HOST#g" properties.ini && \
python3 __main__.py $RABBITMQ_HOST deployer
CMD python3 __main__.py $RABBITMQ_HOST deployer
......@@ -8,16 +8,14 @@ import os
import sys
import tempfile
import time
import traceback
from threading import Thread
from time import sleep
from service.deploy_service import DeployService
from service.tosca_helper import ToscaHelper
import pika
import sure_tosca_client
import yaml
from service.deploy_service import DeployService
from service.tosca_helper import ToscaHelper
logger = logging.getLogger(__name__)
done = False
......@@ -84,37 +82,25 @@ def handle_delivery(message):
tosca_helper = ToscaHelper(sure_tosca_base_url, tosca_template_path)
# nodes_to_deploy = tosca_helper.get_application_nodes()
nodes = tosca_helper.get_deployment_node_pipeline()
nodes_pairs = tosca_helper.get_deployment_node_pairs()
deployService = DeployService(semaphore_base_url=semaphore_base_url, semaphore_username=semaphore_username,
semaphore_password=semaphore_password, vms=tosca_helper.get_vms())
try:
for node in nodes:
updated_node = deployService.deploy(node)
if isinstance(updated_node, list):
for node in updated_node:
tosca_template_dict = tosca_helper.set_node(node,tosca_template_dict)
# logger.info("tosca_template_dict :" + json.dumps(tosca_template_dict))
else:
tosca_template_dict = tosca_helper.set_node(updated_node, tosca_template_dict)
# logger.info("tosca_template_dict :" + json.dumps(tosca_template_dict))
response = {'toscaTemplate': tosca_template_dict}
output_current_milli_time = int(round(time.time() * 1000))
response["creationDate"] = output_current_milli_time
logger.info("Returning Deployment")
logger.info("Output message:" + json.dumps(response))
return json.dumps(response)
except Exception as e:
track = traceback.format_exc()
print(track)
raise
semaphore_password=semaphore_password)
for node_pair in nodes_pairs:
deployService.deploy(node_pair)
response = {'toscaTemplate': tosca_template_dict}
output_current_milli_time = int(round(time.time() * 1000))
response["creationDate"] = output_current_milli_time
logger.info("Returning Deployment")
logger.info("Output message:" + json.dumps(response))
return json.dumps(response)
def threaded_function(args):
while not done:
connection.process_data_events()
sleep(8)
sleep(5)
if __name__ == "__main__":
......
[tosca-sure]
base_url = http://127.0.0.1:8081/tosca-sure/1.0.0
base_url = http://localhost:8081/tosca-sure/1.0.0
[semaphore]
username = admin
password = password
base_url = http://127.0.0.1:3000/api
base_url = http://localhost:3000/api
[message_broker]
host = 127.0.0.1
host = localhost
queue_name = deployer
\ No newline at end of file
pika==1.1.0
names==0.3.0
networkx==2.4
# requests==2.23.0
requests==2.23.0
wheel==0.34.2
pyyaml==5.3.1
matplotlib==3.3.0
ansible==2.9.11
# certifi==2020.4.5.1
matplotlib==3.2.1
# ansible==2.9.6
certifi==2020.4.5.1
six==1.14.0
python_dateutil==2.8.1
# setuptools==46.1.3
# urllib3==1.25.8
kubernetes==11.0.0
sure_tosca_client==1.0.0
\ No newline at end of file
setuptools==46.1.3
urllib3==1.25.8
kubernetes==11.0.0
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -13,4 +13,4 @@ docker exec -t mongo-inst mongo -eval 'db.user.insert({"password":"$2a$10$QdysFg
#--------------------------Git-------------------------------------------
git add .
git commit -m "$MESSAGE"
git push origin
git push origin
\ No newline at end of file
This diff is collapsed.
......@@ -33,9 +33,7 @@ spec:
value: rabbit
- name: SURE_TOSCA_BASE_PATH
value: http://sure-tosca:8081/tosca-sure/1.0.0
- name: SEMAPHORE_BASE_PATH
value: http://semaphore:3000/api
image: qcdis/deployer
image: qcdis/deployer:3.0.0
name: deployer
imagePullPolicy: Always
resources: {}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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