Commit 779bc2e5 authored by Spiros Koulouzis's avatar Spiros Koulouzis

move interfaces

added SURE Simple qUeRy sErvice TOSCA swagger
implementing cloudstorm service for provisioner
parent 56b5187a
...@@ -38,7 +38,7 @@ public class ProvisionerService { ...@@ -38,7 +38,7 @@ public class ProvisionerService {
String ymlToscaTemplate = toscaTemplateService.findByID(id); String ymlToscaTemplate = toscaTemplateService.findByID(id);
ToscaTemplate toscaTemplate = toscaTemplateService.getYaml2ToscaTemplate(ymlToscaTemplate); ToscaTemplate toscaTemplate = toscaTemplateService.getYaml2ToscaTemplate(ymlToscaTemplate);
TOSCAUtils.getNodesByType(toscaTemplate);
return null; return null;
} }
......
...@@ -17,6 +17,7 @@ package nl.uva.sne.drip.provisioner; ...@@ -17,6 +17,7 @@ package nl.uva.sne.drip.provisioner;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.SerializationFeature;
import com.jcraft.jsch.JSchException;
import com.rabbitmq.client.AMQP; import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel; import com.rabbitmq.client.Channel;
import com.rabbitmq.client.DefaultConsumer; import com.rabbitmq.client.DefaultConsumer;
...@@ -52,7 +53,8 @@ public class Consumer extends DefaultConsumer { ...@@ -52,7 +53,8 @@ public class Consumer extends DefaultConsumer {
} }
@Override @Override
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException { public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException, FileNotFoundException {
try {
//Create the reply properties which tells us where to reply, and which id to use. //Create the reply properties which tells us where to reply, and which id to use.
//No need to change anything here //No need to change anything here
AMQP.BasicProperties replyProps = new AMQP.BasicProperties.Builder() AMQP.BasicProperties replyProps = new AMQP.BasicProperties.Builder()
...@@ -78,9 +80,12 @@ public class Consumer extends DefaultConsumer { ...@@ -78,9 +80,12 @@ public class Consumer extends DefaultConsumer {
logger.log(Level.INFO, "Sending Response: '{'0'}'{0}", response); logger.log(Level.INFO, "Sending Response: '{'0'}'{0}", response);
// Logger.getLogger(Consumer.class.getName()).log(Level.INFO, "Sending Response: {0}", response); // Logger.getLogger(Consumer.class.getName()).log(Level.INFO, "Sending Response: {0}", response);
//We send the response back. No need to change anything here //We send the response back. No need to change anything here
channel.basicPublish("", properties.getReplyTo(), replyProps, response.getBytes("UTF-8")); channel.basicPublish("", properties.getReplyTo(), replyProps, response.getBytes("UTF-8"));
channel.basicAck(envelope.getDeliveryTag(), false); channel.basicAck(envelope.getDeliveryTag(), false);
} catch (JSchException ex) {
Logger.getLogger(Consumer.class.getName()).log(Level.SEVERE, null, ex);
}
} }
......
...@@ -55,6 +55,7 @@ class ProvisionerRPCService { ...@@ -55,6 +55,7 @@ class ProvisionerRPCService {
subnetMap.put("name", "subnet" + counter++); subnetMap.put("name", "subnet" + counter++);
subnetMap.put("subnet", subnetValue.split("/")[0]); subnetMap.put("subnet", subnetValue.split("/")[0]);
subnetMap.put("netmask", subnetValue.split("/")[1]); subnetMap.put("netmask", subnetValue.split("/")[1]);
Object members = null;
subnetMap.put("members", members); subnetMap.put("members", members);
subnets.add(subnetMap); subnets.add(subnetMap);
} }
......
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