Add output validation test case for substitution.
[parser.git] / tosca2heat / tosca-parser / toscaparser / tests / data / topology_template / transactionsubsystem.yaml
1 tosca_definitions_version: tosca_simple_yaml_1_0
2
3 description: >
4   Transaction subsystem, which is service template with topology_template,
5   act as a nested system inside another system and also act as stand
6   alone service template.
7
8 imports:
9   - definitions.yaml
10
11 topology_template:
12   description: Template of a database including its hosting stack.
13
14   inputs:
15     mq_server_ip:
16       type: string
17       description: IP address of the message queuing server to receive messages from.
18       default: 127.0.0.1
19     receiver_port:
20       type: integer
21       description: Port to be used for receiving messages.
22       default: 8080
23     my_cpus:
24       type: integer
25       description: Number of CPUs for the server.
26       default: 2
27       constraints:
28         - valid_values: [ 1, 2, 4, 8 ]
29
30   substitution_mappings:
31     node_type: example.TransactionSubsystem
32     capabilities:
33       message_receiver: [ app, message_receiver ]
34     requirements:
35       database_endpoint: [ app, database ]
36
37   node_templates:
38     app:
39       type: example.SomeApp
40       properties:
41         admin_user: foo
42         pool_size: 10
43       capabilities:
44         message_receiver:
45           properties:
46             server_ip: { get_input: mq_server_ip }
47       requirements:
48         - host:
49             node: websrv
50
51     websrv:
52       type: tosca.nodes.WebServer
53       capabilities:
54         data_endpoint:
55           properties:
56             port_name: { get_input: receiver_port }
57       requirements:
58         - host:
59             node: server
60
61     server:
62       type: tosca.nodes.Compute
63       capabilities:
64         host:
65           properties:
66             disk_size: 10 GB
67             num_cpus: { get_input: my_cpus }
68             mem_size: 4096 MB
69         os:
70           properties:
71             architecture: x86_64
72             type: Linux
73             distribution: Ubuntu
74             version: 14.04
75
76   outputs:
77     receiver_ip:
78       description: private IP address of the message receiver application
79       value: { get_attribute: [ server, private_address ] }
80
81     receiver_port:
82       description: receiver_port of the message receiver application
83       value: { get_input: receiver_port }
84
85   groups:
86     webserver_group:
87       members: [ websrv, server ]
88       type: tosca.groups.Root