summaryrefslogtreecommitdiffstats
path: root/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template
diff options
context:
space:
mode:
Diffstat (limited to 'tosca2heat/tosca-parser/toscaparser/tests/data/topology_template')
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/definitions.yaml53
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/subsystem.yaml83
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/system.yaml57
3 files changed, 193 insertions, 0 deletions
diff --git a/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/definitions.yaml b/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/definitions.yaml
new file mode 100644
index 0000000..cfa0614
--- /dev/null
+++ b/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/definitions.yaml
@@ -0,0 +1,53 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+node_types:
+ example.TransactionSubsystem:
+ properties:
+ mq_server_ip:
+ type: string
+ receiver_port:
+ type: integer
+ attributes:
+ receiver_ip:
+ type: string
+ receiver_port:
+ type: integer
+ capabilities:
+ message_receiver:
+ type: example.capabilities.Receiver
+ requirements:
+ - database_endpoint:
+ capability: tosca.capabilities.Endpoint.Database
+ node: tosca.nodes.Database
+ relationship: tosca.relationships.ConnectsTo
+
+ example.QueuingSubsystem:
+ derived_from: tosca.nodes.SoftwareComponent
+ requirements:
+ - receiver1:
+ node: example.TransactionSubsystem
+ relationship: tosca.relationships.ConnectsTo
+ - receiver2:
+ node: example.TransactionSubsystem
+ relationship: tosca.relationships.ConnectsTo
+
+ example.DatabaseSubsystem:
+ derived_from: tosca.nodes.Database
+
+ example.SomeApp:
+ derived_from: tosca.nodes.SoftwareComponent
+ properties:
+ admin_user:
+ type: string
+ pool_size:
+ type: integer
+ capabilities:
+ message_receiver:
+ type: example.capabilities.Receiver
+
+capability_types:
+ example.capabilities.Receiver:
+ derived_from: tosca.capabilities.Endpoint
+ properties:
+ server_ip:
+ type: string
diff --git a/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/subsystem.yaml b/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/subsystem.yaml
new file mode 100644
index 0000000..b27e698
--- /dev/null
+++ b/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/subsystem.yaml
@@ -0,0 +1,83 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: >
+ Service template with topology_template, act as a nested system inside another system.
+
+imports:
+ - definitions.yaml
+
+topology_template:
+ description: Template of a database including its hosting stack.
+
+ inputs:
+ mq_server_ip:
+ type: string
+ description: IP address of the message queuing server to receive messages from.
+ receiver_port:
+ type: string
+ description: Port to be used for receiving messages.
+ my_cpus:
+ type: integer
+ description: Number of CPUs for the server.
+ constraints:
+ - valid_values: [ 1, 2, 4, 8 ]
+
+ substitution_mappings:
+ node_type: example.TransactionSubsystem
+ capabilities:
+ message_receiver: [ app, message_receiver ]
+ requirements:
+ database_endpoint: [ app, database ]
+
+ node_templates:
+ app:
+ type: example.SomeApp
+ properties:
+ admin_user: foo
+ pool_size: 10
+ capabilities:
+ message_receiver:
+ properties:
+ server_ip: { get_input: mq_server_ip }
+ requirements:
+ - host:
+ node: websrv
+
+ websrv:
+ type: tosca.nodes.WebServer
+ capabilities:
+ data_endpoint:
+ properties:
+ port_name: { get_input: receiver_port }
+ requirements:
+ - host:
+ node: server
+
+ server:
+ type: tosca.nodes.Compute
+ capabilities:
+ host:
+ properties:
+ disk_size: 10 GB
+ num_cpus: { get_input: my_cpus }
+ mem_size: 4096 MB
+ os:
+ properties:
+ architecture: x86_64
+ type: Linux
+ distribution: Ubuntu
+ version: 14.04
+
+ outputs:
+ receiver_ip:
+ description: private IP address of the message receiver application
+ value: { get_attribute: [ server, private_address ] }
+# It seems current _process_intrisic_function can not handle more than 2 arguments, save it for later
+# receiver_port:
+# description: Port of the message receiver endpoint
+# value: { get_attribute: [ app, data_endpoint, port_name ] }
+
+ groups:
+ webserver_group:
+ members: [ websrv, server ]
+ type: tosca.groups.Root
diff --git a/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/system.yaml b/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/system.yaml
new file mode 100644
index 0000000..2d459aa
--- /dev/null
+++ b/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/system.yaml
@@ -0,0 +1,57 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+imports:
+ - definitions.yaml
+
+topology_template:
+ description: Template of online transaction processing service.
+
+ node_templates:
+ mq:
+ type: example.QueuingSubsystem
+ # properties:
+ # to be updated when substitution_mapping is implemented
+ # capabilities:
+ # message_queue_endpoint:
+ # to be updated when substitution_mapping is implemented
+ requirements:
+ - receiver1: trans1
+ - receiver2: trans2
+
+ trans1:
+ type: example.TransactionSubsystem
+ properties:
+ # TODO to be updated when substitution_mapping is implemented
+ # mq_server_ip: { get_attribute: [ mq, server_ip ] }
+ # for now, we will use the loopback address to avoid errors as
+ # this property is required in the schema
+ mq_server_ip: 127.0.0.1
+ receiver_port: 8080
+ # capabilities:
+ # message_receiver:
+ # to be updated when substitution_mapping is implemented
+ requirements:
+ - database_endpoint: dbsys
+
+ trans2:
+ type: example.TransactionSubsystem
+ properties:
+ # TODO to be updated when substitution_mapping is implemented
+ # mq_server_ip: { get_attribute: [ mq, server_ip ] }
+ # for now, we will use the loopback address to avoid errors as
+ # this property is required in the schema
+ mq_server_ip: 127.0.0.1
+ receiver_port: 8080
+ # capabilities:
+ # message_receiver:
+ # to be updated when substitution_mapping is implemented
+ requirements:
+ - database_endpoint: dbsys
+
+ dbsys:
+ type: example.DatabaseSubsystem
+ # properties:
+ # to be updated when substitution_mapping is implemented
+ # capabilities:
+ # database_endpoint:
+ # to be updated when substitution_mapping is implemented \ No newline at end of file