Add output validation test case for substitution.
[parser.git] / tosca2heat / tosca-parser / toscaparser / tests / data / topology_template / validate / queuingsubsystem_invalid_input.yaml
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
43   node_templates:
44     tran_app:
45       type: example.QueuingSubsystem
46       properties:
47         server_ip: { get_input: server_ip }
48         server_port: { get_input: server_port1 }
49       requirements:
50         - host:
51             node: server
52
53     server:
54       type: tosca.nodes.Compute
55       capabilities:
56         host:
57           properties:
58             disk_size: 10 GB
59             num_cpus: { get_input: my_cpus }
60             mem_size: 4096 MB
61         os:
62           properties:
63             architecture: x86_64
64             type: Linux
65             distribution: Ubuntu
66             version: 14.04
67
68   outputs:
69     receiver_ip:
70       description: private IP address of the message receiver application
71       value: { get_attribute: [ server, private_address ] }
72
73   groups:
74     tran_server_group:
75       members: [ tran_app, server ]
76       type: tosca.groups.Root