Commit b3212717 authored by Spiros Koulouzis's avatar Spiros Koulouzis

try to implement delete

parent 98461ebf
......@@ -204,7 +204,7 @@ node_types:
disk_size:
type: scalar-unit.size
required: true
default: 20000 MB
default: 10000 MB
constraints:
- greater_or_equal: 15000 MB
mem_size:
......
......@@ -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.Message;
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.ToscaTemplate;
import nl.uva.sne.drip.rpc.DRIPCaller;
......@@ -154,19 +155,21 @@ public class DRIPService {
}
public String delete(String id, List<String> nodeNames) throws NotFoundException, IOException, JsonProcessingException, ApiException, TypeExeption, TimeoutException, InterruptedException {
// ToscaTemplate toscaTemplate = initExecution(id);
// if (nodeNames == null || nodeNames.isEmpty()) {
// List<NodeTemplateMap> vmTopologies = helper.getVMTopologyTemplates();
// if (vmTopologies != null) {
// for (NodeTemplateMap vmTopology : vmTopologies) {
// CloudsStormSubTopology.StatusEnum status = helper.getVMTopologyTemplateStatus(vmTopology);
// if (!status.equals(CloudsStormSubTopology.StatusEnum.DELETED)) {
// toscaTemplate = setDesieredSate(toscaTemplate, vmTopologies, NODE_STATES.DELETE);
// }
// }
// return execute(toscaTemplate, provisionerQueueName);
// }
// }
ToscaTemplate toscaTemplate = initExecution(id);
//If no nodes are specified delete all the infrastructure
if (nodeNames == null || nodeNames.isEmpty()) {
List<NodeTemplateMap> vmTopologies = helper.getVMTopologyTemplates();
for (NodeTemplateMap vmTopology : vmTopologies) {
CloudsStormSubTopology.StatusEnum status = helper.getVMTopologyTemplateStatus(vmTopology);
if (!status.equals(CloudsStormSubTopology.StatusEnum.DELETED)) {
toscaTemplate = setDesieredSate(toscaTemplate, vmTopologies, NODE_STATES.DELETE);
}
}
return execute(toscaTemplate, provisionerQueueName);
}else{
}
return null;
}
......
......@@ -165,7 +165,7 @@ class CloudStormService {
Set<PosixFilePermission> perms = new HashSet<>();
perms.add(PosixFilePermission.OWNER_READ);
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;
}
......
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