c54c12cb8d6a18e00b6b9727ce88a5a8484294dd
[parser.git] /
1 tosca_definitions_version: tosca_simple_yaml_1_0
2
3 description: >
4   This template is a test template which contains invalid input needed for substitution mappings.
5   The required properties without default value in substituted node template which be mapped must be
6   as inputs of nested service template which defines substutition mappings, and the inputs of nested
7   service template which are not in the properties of the substituted node template must provide
8   default values.
9   This template provides an additional input of server_port1/my_cpus/my_input which are not defined
10   in example.QueuingSubsystem, and the default value are 8080/2/123, all of these are right. But the
11   required property of server_port defined in example.QueuingSubsystem is not appeared in inputs
12   definiton, so will raise excepton of "MissingRequiredInputError".
13
14 imports:
15   - ../definitions.yaml
16
17 topology_template:
18   description: Template of a database including its hosting stack.
19
20   inputs:
21     server_ip:
22       type: string
23       description: IP address of the message queuing server to receive messages from.
24       default: 127.0.0.1
25     server_port1:
26       type: integer
27       description: Port to be used for receiving messages.
28       default: 8080
29     my_cpus:
30       type: integer
31       description: Number of CPUs for the server.
32       default: 2
33       constraints:
34         - valid_values: [ 1, 2, 4, 8 ]
35     my_input:
36       type: integer
37       description: test for input validation.
38       default: 123
39
40   substitution_mappings:
41     node_type: example.QueuingSubsystem
42     requirements:
43       receiver1: [ tran_app, receiver1 ]
44       receiver2: [ tran_app, receiver2 ]
45
46   node_templates:
47     tran_app:
48       type: example.QueuingSubsystem
49       properties:
50         server_ip: { get_input: server_ip }
51         server_port: { get_input: server_port1 }
52       requirements:
53         - host:
54             node: server
55
56     server:
57       type: tosca.nodes.Compute
58       capabilities:
59         host:
60           properties:
61             disk_size: 10 GB
62             num_cpus: { get_input: my_cpus }
63             mem_size: 4096 MB
64         os:
65           properties:
66             architecture: x86_64
67             type: Linux
68             distribution: Ubuntu
69             version: 14.04
70
71   outputs:
72     receiver_ip:
73       description: private IP address of the message receiver application
74       value: { get_attribute: [ server, private_address ] }
75
76   groups:
77     tran_server_group:
78       members: [ tran_app, server ]
79       type: tosca.groups.Root