Commit 2a59a2d7 authored by skoulouzis's avatar skoulouzis

update

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