Commit 7902a445 authored by Spiros Koulouzis's avatar Spiros Koulouzis

added username property

parent d81db714
tosca_definitions_version: tosca_simple_yaml_1_0 tosca_definitions_version: tosca_simple_yaml_1_0
imports: imports:
- nodes: types/nodes.yaml - nodes: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/nodes.yaml
- capabilities: types/capabilities.yaml - capabilities: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/capabilities.yaml
- policies: types/policies.yaml - policies: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/policies.yaml
repositories:
docker_hub: https://hub.docker.com/
description: > description: >
TOSCA example TOSCA example
......
tosca_definitions_version: tosca_simple_yaml_1_0 tosca_definitions_version: tosca_simple_yaml_1_0
repositories:
docker_hub: https://hub.docker.com/
imports: imports:
- nodes: types/nodes.yaml - nodes: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/nodes.yaml
- capabilities: types/capabilities.yaml - capabilities: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/capabilities.yaml
- policies: types/policies.yaml - policies: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/policies.yaml
description: >
TOSCA example
topology_template: topology_template:
node_templates: node_templates:
erica_topology: beverly_topology:
interfaces: interfaces:
Standard: Standard:
create: dumy.yaml create: dumy.yaml
...@@ -22,38 +20,38 @@ topology_template: ...@@ -22,38 +20,38 @@ topology_template:
requirements: requirements:
- vm: - vm:
capability: tosca.capabilities.ARTICONF.VM capability: tosca.capabilities.ARTICONF.VM
node: james_compute node: nancy_compute
relationship: tosca.relationships.DependsOn relationship: tosca.relationships.DependsOn
- vm: - vm:
capability: tosca.capabilities.ARTICONF.VM capability: tosca.capabilities.ARTICONF.VM
node: james_compute node: nancy_compute
relationship: tosca.relationships.DependsOn relationship: tosca.relationships.DependsOn
type: tosca.nodes.ARTICONF.VM.topology type: tosca.nodes.ARTICONF.VM.topology
heather_kubernetes: charles_compute:
interfaces:
Standard:
create: dumy.yaml
properties:
cpu_frequency: 2.9 GHz
disk_size: 25000 MB
host_name: vm
mem_size: 3000 MB
num_cpus: 1
type: tosca.nodes.ARTICONF.VM.Compute
heidi_kubernetes:
interfaces: interfaces:
Standard: Standard:
create: interfaces/playbooks/kubernetes_install.yaml create: interfaces/playbooks/kubernetes_install.yaml
requirements: requirements:
- host: - host:
capability: tosca.capabilities.Scalable capability: tosca.capabilities.Scalable
node: erica_topology node: beverly_topology
relationship: tosca.relationships.HostedOn relationship: tosca.relationships.HostedOn
- host: - host:
capability: tosca.capabilities.Compute capability: tosca.capabilities.Compute
node: erica_topology node: beverly_topology
relationship: tosca.relationships.HostedOn relationship: tosca.relationships.HostedOn
type: tosca.nodes.ARTICONF.Orchestrator.Kubernetes type: tosca.nodes.ARTICONF.Orchestrator.Kubernetes
james_compute:
interfaces:
Standard:
create: dumy.yaml
properties:
cpu_frequency: 2.9 GHz
disk_size: 25000 MB
host_name: vm
mem_size: 3000 MB
num_cpus: 1
type: tosca.nodes.ARTICONF.VM.Compute
mysql: mysql:
artifacts: artifacts:
image: image:
...@@ -71,10 +69,10 @@ topology_template: ...@@ -71,10 +69,10 @@ topology_template:
requirements: requirements:
- host: - host:
capability: tosca.capabilities.ARTICONF.Orchestrator capability: tosca.capabilities.ARTICONF.Orchestrator
node: heather_kubernetes node: heidi_kubernetes
relationship: tosca.relationships.HostedOn relationship: tosca.relationships.HostedOn
type: tosca.nodes.ARTICONF.Container.Application.Docker type: tosca.nodes.ARTICONF.Container.Application.Docker
shenita_compute: nancy_compute:
interfaces: interfaces:
Standard: Standard:
create: dumy.yaml create: dumy.yaml
......
...@@ -77,6 +77,9 @@ node_types: ...@@ -77,6 +77,9 @@ node_types:
compute: compute:
type: tosca.capabilities.ARTICONF.VM type: tosca.capabilities.ARTICONF.VM
properties: properties:
user_name:
type: string
required: true
host_name: host_name:
type: string type: string
required: true required: true
......
...@@ -103,7 +103,7 @@ public abstract class DRIPCaller implements AutoCloseable { ...@@ -103,7 +103,7 @@ public abstract class DRIPCaller implements AutoCloseable {
.correlationId(corrId) .correlationId(corrId)
.replyTo(getReplyQueueName()) .replyTo(getReplyQueueName())
.build(); .build();
Logger.getLogger(DRIPCaller.class.getName()).log(Level.INFO, "Sending: {0}", jsonInString); Logger.getLogger(DRIPCaller.class.getName()).log(Level.INFO, "Sending: " + jsonInString + " to queue: " + requestQeueName);
getChannel().basicPublish("", requestQeueName, props, jsonInString.getBytes("UTF-8")); getChannel().basicPublish("", requestQeueName, props, jsonInString.getBytes("UTF-8"));
final BlockingQueue<String> response = new ArrayBlockingQueue(1); final BlockingQueue<String> response = new ArrayBlockingQueue(1);
...@@ -128,7 +128,7 @@ public abstract class DRIPCaller implements AutoCloseable { ...@@ -128,7 +128,7 @@ public abstract class DRIPCaller implements AutoCloseable {
clean = clean.replaceAll("\"null\"", "null"); clean = clean.replaceAll("\"null\"", "null");
} }
Logger.getLogger(DRIPCaller.class.getName()).log(Level.INFO, "Got: {0}", clean); Logger.getLogger(DRIPCaller.class.getName()).log(Level.INFO, "Got: {0}", clean);
return mapper.readValue(clean, Message.class); return mapper.readValue(clean, Message.class);
} }
} }
...@@ -89,42 +89,33 @@ public class PlannerService { ...@@ -89,42 +89,33 @@ public class PlannerService {
ObjectMapper mapper = new ObjectMapper(); ObjectMapper mapper = new ObjectMapper();
mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true); mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);
List<MessageParameter> messageParams = plannerReturnedMessage.getParameters(); List<MessageParameter> messageParams = plannerReturnedMessage.getParameters();
StringBuilder jsonArrayString = new StringBuilder();
jsonArrayString.append("[");
String prefix = "";
for (MessageParameter mp : messageParams) { for (MessageParameter mp : messageParams) {
String value = mp.getValue(); String value = mp.getValue();
jsonArrayString.append(prefix); logger.log(Level.INFO, "value: "+value);
prefix = ",";
String jsonValue = value.replaceAll("\\\"", "\"");
jsonArrayString.append(jsonValue);
}
jsonArrayString.append("]");
if (cloudProvider == null) {
cloudProvider = getBestCloudProvider();
} }
String domainName = getBestDomain(cloudProvider); String domainName = getBestDomain(cloudProvider);
SimplePlanContainer simplePlan = P2PConverter.transfer(jsonArrayString.toString(), "vm_user", domainName, cloudProvider); // SimplePlanContainer simplePlan = P2PConverter.transfer(jsonArrayString.toString(), "vm_user", domainName, cloudProvider);
PlanResponse topLevel = new PlanResponse(); PlanResponse topLevel = new PlanResponse();
topLevel.setLevel(0); // topLevel.setLevel(0);
topLevel.setToscaID(toscaId); // topLevel.setToscaID(toscaId);
topLevel.setName("planner_output_all.yml"); // topLevel.setName("planner_output_all.yml");
topLevel.setKvMap(Converter.ymlString2Map(simplePlan.topLevelContents)); // topLevel.setKvMap(Converter.ymlString2Map(simplePlan.topLevelContents));
Map<String, String> map = simplePlan.lowerLevelContents; // Map<String, String> map = simplePlan.lowerLevelContents;
Set<String> loweLevelPlansIDs = new HashSet<>(); // Set<String> loweLevelPlansIDs = new HashSet<>();
for (String lowLevelNames : map.keySet()) { // for (String lowLevelNames : map.keySet()) {
PlanResponse lowLevelPlan = new PlanResponse(); // PlanResponse lowLevelPlan = new PlanResponse();
lowLevelPlan.setLevel(1); // lowLevelPlan.setLevel(1);
lowLevelPlan.setToscaID(toscaId); // lowLevelPlan.setToscaID(toscaId);
lowLevelPlan.setName(lowLevelNames); // lowLevelPlan.setName(lowLevelNames);
lowLevelPlan.setKvMap(Converter.ymlString2Map(map.get(lowLevelNames))); // lowLevelPlan.setKvMap(Converter.ymlString2Map(map.get(lowLevelNames)));
save(lowLevelPlan); // save(lowLevelPlan);
loweLevelPlansIDs.add(lowLevelPlan.getId()); // loweLevelPlansIDs.add(lowLevelPlan.getId());
} // }
//
topLevel.setLoweLevelPlansIDs(loweLevelPlansIDs); // topLevel.setLoweLevelPlansIDs(loweLevelPlansIDs);
save(topLevel); save(topLevel);
logger.log(Level.INFO, "Plan saved"); logger.log(Level.INFO, "Plan saved");
return topLevel; return topLevel;
......
/*
* Copyright 2019 S. Koulouzis, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package nl.uva.sne.drip.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.webcohesion.enunciate.metadata.rs.ResponseCode;
import com.webcohesion.enunciate.metadata.rs.StatusCodes;
import nl.uva.sne.drip.service.CloudStormService;
import nl.uva.sne.drip.service.PlannerService;
import org.springframework.beans.factory.annotation.Autowired;
/**
* This controller is responsible for obtaining resources from cloud providers
*
*
* @author S. Koulouzis
*/
@RestController
@RequestMapping("/user/v3.0/planner")
@StatusCodes({
@ResponseCode(code = 401, condition = "Bad credentials")
})
public class PlannerController {
@Autowired
private PlannerService plannerService;
}
/*
* Copyright 2019 S. Koulouzis, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package nl.uva.sne.drip.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.webcohesion.enunciate.metadata.rs.ResponseCode;
import com.webcohesion.enunciate.metadata.rs.StatusCodes;
import nl.uva.sne.drip.service.CloudStormService;
import org.springframework.beans.factory.annotation.Autowired;
/**
* This controller is responsible for obtaining resources from cloud providers
*
*
* @author S. Koulouzis
*/
@RestController
@RequestMapping("/user/v3.0/provisioner")
@StatusCodes({
@ResponseCode(code = 401, condition = "Bad credentials")
})
public class ProvisionController {
@Autowired
private CloudStormService provisionService;
}
/*
* Copyright 2019 S. Koulouzis, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package nl.uva.sne.drip.service;
import lambdaInfrs.engine.TEngine.TEngine;
import nl.uva.sne.drip.drip.commons.model.InfrastructureDescription;
import org.springframework.amqp.rabbit.connection.CachingConnectionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import topology.analysis.TopologyAnalysisMain;
/**
*
* @author S. Koulouzis
*/
@Service
public class CloudStormService {
@Value("${provisioner.queue.prefix}")
private String provisionerQueuePrefix;
public InfrastructureDescription provision(InfrastructureDescription description) {
return null;
}
public InfrastructureDescription start() {
return null;
}
public InfrastructureDescription stop() {
return null;
}
public InfrastructureDescription delete() {
return null;
}
public InfrastructureDescription recover() {
return null;
}
public InfrastructureDescription detectFailure() {
return null;
}
public InfrastructureDescription scale() {
return null;
}
}
/*
* Copyright 2019 S. Koulouzis, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package nl.uva.sne.drip.service;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
/**
*
* @author S. Koulouzis
*/
@Service
public class PlannerService {
@Value("${planner.queue.prefix}")
private String plannerQueuePrefix;
}
/*
* Copyright 2019 S. Koulouzis, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package nl.uva.sne.drip.drip.commons.model.tosca;
/**
*
* @author S. Koulouzis
*/
public class Artifact {
}
/*
* Copyright 2019 S. Koulouzis, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package nl.uva.sne.drip.drip.commons.model.tosca;
/**
*
* @author S. Koulouzis
*/
public abstract class Attribute {
}
/*
* Copyright 2019 S. Koulouzis, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package nl.uva.sne.drip.drip.commons.model.tosca;
/**
*
* @author S. Koulouzis
*/
public enum Constraint {
EQUAL,
GREATERTHAN,
GREATEROREQUAL,
LESSTHAN,
INRANGE,
VALIDVALUES,
LENGTH,
MINLENGTH,
MAXLENGTH,
PATTERN;
}
/*
* Copyright 2019 S. Koulouzis, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package nl.uva.sne.drip.drip.commons.model.tosca;
import java.util.List;
/**
*
* @author S. Koulouzis
*/
public abstract class EntrySchema {
@org.neo4j.ogm.annotation.Property(name = "type")
private String type;
@org.neo4j.ogm.annotation.Property(name = "description")
private String description;
@org.neo4j.ogm.annotation.Property(name = "constraints")
private List<Constraint> constraints;
}
/*
* Copyright 2019 S. Koulouzis, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package nl.uva.sne.drip.drip.commons.model.tosca;
/**
*
* @author S. Koulouzis
*/
public abstract class Interface {
}
/*
* Copyright 2019 S. Koulouzis, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package nl.uva.sne.drip.drip.commons.model.tosca;
import java.util.List;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.namespace.QName;
/**
*
* @author S. Koulouzis
*/
public abstract class Property {
@org.neo4j.ogm.annotation.Property(name = "type")
private String type;
@org.neo4j.ogm.annotation.Property(name = "description")
private String description;
@org.neo4j.ogm.annotation.Property(name = "required")
private Boolean required;
@org.neo4j.ogm.annotation.Property(name = "default")
private Object defaultValue;
@org.neo4j.ogm.annotation.Property(name = "status")
private PropertyStatus status;
@org.neo4j.ogm.annotation.Property(name = "constraints")
private List<Constraint> constraints;
@org.neo4j.ogm.annotation.Property(name = "entry_schema")
private EntrySchema entrySchema;
}
/*
* Copyright 2019 S. Koulouzis, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package nl.uva.sne.drip.drip.commons.model.tosca;
/**
*
* @author S. Koulouzis
*/
public enum PropertyStatus {
SUPPORTED,
UNSUPPORTED,
EXPERIMENTAL,
DEPRECTED;
}
/*
* Copyright 2019 S. Koulouzis, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package nl.uva.sne.drip.drip.commons.model.tosca;
/**
*
* @author S. Koulouzis
*/
public abstract class Requirement {
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package nl.uva.sne.drip.drip.commons.model.tosca.capabilities;
import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.namespace.QName;
import nl.uva.sne.drip.drip.commons.model.tosca.Attribute;
import org.neo4j.ogm.annotation.Properties;
import org.neo4j.ogm.annotation.Property;
/**
* http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.0/os/TOSCA-Simple-Profile-YAML-v1.0-os.html#DEFN_TYPE_CAPABILITIES_ROOT
*
* @author alogo
*/
public abstract class Capabilities {
@Property(name = "type")
private String type;
@Property(name = "description")
private String description;
@Property(name = "valid_source_types")
private List<String> validSourceTypes;
@Property(name = "occurrences")
private List<String> occurrences;
@Properties
private Map<String, nl.uva.sne.drip.drip.commons.model.tosca.Property> properties;
@Properties
private Map<String, Attribute> attributes;
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package nl.uva.sne.drip.drip.commons.model.tosca.nodes;
/**
*
* @author S. Koulouzis
*/
//http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.0/os/TOSCA-Simple-Profile-YAML-v1.0-os.html#DEFN_TOSCA_VALUES_STATE
public enum NodeState {
INITIAL,
CREATING,
CREATED,
CONFIGURING,
CONFIGURED,
STARTING,
STARTED,
STOPPING,
DELETING,
ERROR;
}
package nl.uva.sne.drip.drip.commons.model.tosca.nodes;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import nl.uva.sne.drip.drip.commons.model.tosca.Artifact;
import nl.uva.sne.drip.drip.commons.model.tosca.Attribute;
import nl.uva.sne.drip.drip.commons.model.tosca.Interface;
import nl.uva.sne.drip.drip.commons.model.tosca.Requirement;
import nl.uva.sne.drip.drip.commons.model.tosca.capabilities.Capabilities;
import org.neo4j.ogm.annotation.GeneratedValue;
import org.neo4j.ogm.annotation.Id;
import org.neo4j.ogm.annotation.NodeEntity;
import org.neo4j.ogm.annotation.Properties;
import org.neo4j.ogm.annotation.Property;
/**
*
* @author S. Koulouzis
*/
@NodeEntity
public abstract class RootNode {
@Id
@GeneratedValue
private Long tosca_id;
@Property(name = "tosca_name")
private String tosca_name;
@Property(name = "state")
private NodeState state;
@Properties
private Map<String, Capabilities> capabilities;
@Properties
private Map<String, Attribute> attributes;
@Properties
private List<Requirement> requirements;
@Properties
private Map<String, Interface> interfaces;
@Properties
private Map<String, Artifact> artifacts;
/**
* @return the tosca_name
*/
public String getTosca_name() {
return tosca_name;
}
/**
* @param tosca_name the tosca_name to set
*/
public void setTosca_name(String tosca_name) {
this.tosca_name = tosca_name;
}
/**
* @return the state
*/
public NodeState getState() {
return state;
}
/**
* @param state the state to set
*/
public void setState(NodeState state) {
this.state = state;
}
/**
* @return the capabilities
*/
public Map<String, Capabilities> getCapabilities() {
return capabilities;
}
/**
* @param capabilities the capabilities to set
*/
public void setCapabilities(Map<String, Capabilities> capabilities) {
this.capabilities = capabilities;
}
/**
* @return the attributes
*/
public Map<String, Attribute> getAttributes() {
return attributes;
}
/**
* @param attributes the attributes to set
*/
public void setAttributes(Map<String, Attribute> attributes) {
this.attributes = attributes;
}
/**
* @return the requirements
*/
public List<Requirement> getRequirements() {
return requirements;
}
/**
* @param requirements the requirements to set
*/
public void setRequirements(List<Requirement> requirements) {
this.requirements = requirements;
}
/**
* @return the interfaces
*/
public Map<String, Interface> getInterfaces() {
return interfaces;
}
/**
* @param interfaces the interfaces to set
*/
public void setInterfaces(Map<String, Interface> interfaces) {
this.interfaces = interfaces;
}
/**
* @return the artifacts
*/
public Map<String, Artifact> getArtifacts() {
return artifacts;
}
/**
* @param artifacts the artifacts to set
*/
public void setArtifacts(Map<String, Artifact> artifacts) {
this.artifacts = artifacts;
}
}
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="462ede19-adfe-472b-975e-fefefa973fe0" name="Default Changelist" comment="slolved cap error"> <list default="true" id="462ede19-adfe-472b-975e-fefefa973fe0" name="Default Changelist" comment="slolved cap error">
<change beforePath="$PROJECT_DIR$/../TOSCA/application_example.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/../TOSCA/application_example.yaml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/../TOSCA/application_example.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/../TOSCA/application_example.yaml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../TOSCA/application_example_output.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/../TOSCA/application_example_output.yaml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/api/rpc/DRIPCaller.java" beforeDir="false" afterPath="$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/api/rpc/DRIPCaller.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/api/rpc/DRIPCaller.java" beforeDir="false" afterPath="$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/api/rpc/DRIPCaller.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/controller/PlannerController.java" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/controller/PlannerController.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/controller/ProvisionController.java" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/../drip-api/src/main/java/nl/uva/sne/drip/controller/ProvisionController.java" beforeDir="false" />
...@@ -19,9 +20,6 @@ ...@@ -19,9 +20,6 @@
<change beforePath="$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/capabilities/Capabilities.java" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/capabilities/Capabilities.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/nodes/NodeState.java" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/nodes/NodeState.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/nodes/RootNode.java" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/drip/commons/model/tosca/nodes/RootNode.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/planner/basic_planner.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/planner/basic_planner.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/rpc_server.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/rpc_server.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/venv/lib/python3.6/site-packages/easy-install.pth" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/venv/lib/python3.6/site-packages/easy-install.pth" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/venv/lib/python3.6/site-packages/prettytable.py" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/venv/lib/python3.6/site-packages/prettytable.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/venv/lib/python3.6/site-packages/pyparsing.py" beforeDir="false" /> <change beforePath="$PROJECT_DIR$/venv/lib/python3.6/site-packages/pyparsing.py" beforeDir="false" />
...@@ -134,7 +132,14 @@ ...@@ -134,7 +132,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1568115528728</updated> <updated>1568115528728</updated>
</task> </task>
<option name="localTasksCounter" value="2" /> <task id="LOCAL-00002" summary="format TOSCA output">
<created>1568123822036</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1568123822036</updated>
</task>
<option name="localTasksCounter" value="3" />
<servers /> <servers />
</component> </component>
<component name="Vcs.Log.Tabs.Properties"> <component name="Vcs.Log.Tabs.Properties">
...@@ -153,7 +158,8 @@ ...@@ -153,7 +158,8 @@
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value="slolved cap error" /> <MESSAGE value="slolved cap error" />
<MESSAGE value="produces valid TOSCA" /> <MESSAGE value="produces valid TOSCA" />
<option name="LAST_COMMIT_MESSAGE" value="produces valid TOSCA" /> <MESSAGE value="format TOSCA output" />
<option name="LAST_COMMIT_MESSAGE" value="format TOSCA output" />
</component> </component>
<component name="XDebuggerManager"> <component name="XDebuggerManager">
<breakpoint-manager> <breakpoint-manager>
......
...@@ -46,6 +46,8 @@ def set_VM_properties(node_template_dict): ...@@ -46,6 +46,8 @@ def set_VM_properties(node_template_dict):
node_template_dict['properties'].pop('disk_size') node_template_dict['properties'].pop('disk_size')
node_template_dict['properties']['disk_size'] = get_disk_size() node_template_dict['properties']['disk_size'] = get_disk_size()
node_template_dict['properties']['mem_size'] = get_mem_size() node_template_dict['properties']['mem_size'] = get_mem_size()
node_template_dict['properties'].pop('user_name')
node_template_dict['properties']['user_name'] = 'vm_user'
return node_template_dict return node_template_dict
def set_topology_properties(node_template_dict): def set_topology_properties(node_template_dict):
......
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