Commit b3212717 authored by Spiros Koulouzis's avatar Spiros Koulouzis

try to implement delete

parent 98461ebf
...@@ -204,7 +204,7 @@ node_types: ...@@ -204,7 +204,7 @@ node_types:
disk_size: disk_size:
type: scalar-unit.size type: scalar-unit.size
required: true required: true
default: 20000 MB default: 10000 MB
constraints: constraints:
- greater_or_equal: 15000 MB - greater_or_equal: 15000 MB
mem_size: mem_size:
......
...@@ -19,6 +19,7 @@ import nl.uva.sne.drip.model.Exceptions.MissingVMTopologyException; ...@@ -19,6 +19,7 @@ import nl.uva.sne.drip.model.Exceptions.MissingVMTopologyException;
import nl.uva.sne.drip.model.Exceptions.TypeExeption; import nl.uva.sne.drip.model.Exceptions.TypeExeption;
import nl.uva.sne.drip.model.Message; import nl.uva.sne.drip.model.Message;
import nl.uva.sne.drip.model.NodeTemplateMap; import nl.uva.sne.drip.model.NodeTemplateMap;
import nl.uva.sne.drip.model.cloud.storm.CloudsStormSubTopology;
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.rpc.DRIPCaller; import nl.uva.sne.drip.rpc.DRIPCaller;
...@@ -154,19 +155,21 @@ public class DRIPService { ...@@ -154,19 +155,21 @@ public class DRIPService {
} }
public String delete(String id, List<String> nodeNames) throws NotFoundException, IOException, JsonProcessingException, ApiException, TypeExeption, TimeoutException, InterruptedException { public String delete(String id, List<String> nodeNames) throws NotFoundException, IOException, JsonProcessingException, ApiException, TypeExeption, TimeoutException, InterruptedException {
// ToscaTemplate toscaTemplate = initExecution(id); ToscaTemplate toscaTemplate = initExecution(id);
// if (nodeNames == null || nodeNames.isEmpty()) { //If no nodes are specified delete all the infrastructure
// List<NodeTemplateMap> vmTopologies = helper.getVMTopologyTemplates(); if (nodeNames == null || nodeNames.isEmpty()) {
// if (vmTopologies != null) { List<NodeTemplateMap> vmTopologies = helper.getVMTopologyTemplates();
// for (NodeTemplateMap vmTopology : vmTopologies) { for (NodeTemplateMap vmTopology : vmTopologies) {
// CloudsStormSubTopology.StatusEnum status = helper.getVMTopologyTemplateStatus(vmTopology); CloudsStormSubTopology.StatusEnum status = helper.getVMTopologyTemplateStatus(vmTopology);
// if (!status.equals(CloudsStormSubTopology.StatusEnum.DELETED)) { if (!status.equals(CloudsStormSubTopology.StatusEnum.DELETED)) {
// toscaTemplate = setDesieredSate(toscaTemplate, vmTopologies, NODE_STATES.DELETE); toscaTemplate = setDesieredSate(toscaTemplate, vmTopologies, NODE_STATES.DELETE);
// } }
// } }
// return execute(toscaTemplate, provisionerQueueName); return execute(toscaTemplate, provisionerQueueName);
// } }else{
// }
}
return null; return null;
} }
......
...@@ -165,7 +165,7 @@ class CloudStormService { ...@@ -165,7 +165,7 @@ class CloudStormService {
Set<PosixFilePermission> perms = new HashSet<>(); Set<PosixFilePermission> perms = new HashSet<>();
perms.add(PosixFilePermission.OWNER_READ); perms.add(PosixFilePermission.OWNER_READ);
Files.setPosixFilePermissions(Paths.get(tempInputDirPath + File.separator + userPrivateName), perms); Files.setPosixFilePermissions(Paths.get(tempInputDirPath + File.separator + userPrivateName), perms);
Logger.getLogger(CloudStormService.class.getName()).log(Level.INFO, "Wrote ssh keys in: " + tempInputDirPath + File.separator + userPrivateName); Logger.getLogger(CloudStormService.class.getName()).log(Level.INFO, "Wrote ssh keys in: {0}{1}{2}", new Object[]{tempInputDirPath, File.separator, userPrivateName});
return publicKeyPath; return publicKeyPath;
} }
......
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