Add database subsystem definition in the use case of
[parser.git] / tosca2heat / tosca-parser / toscaparser / tests / data / topology_template / databasesubsystem.yaml
1 tosca_definitions_version: tosca_simple_yaml_1_0
2
3 description: >
4    Database 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     db_user:
16       type: string
17       description: the user name of database.
18       default: test
19     db_port:
20       type: integer
21       description: the port of database.
22       default: 3306
23     db_name:
24       type: string
25       description: the name of database.
26       default: test
27     my_cpus:
28       type: integer
29       description: Number of CPUs for the server.
30       default: 2
31       constraints:
32         - valid_values: [ 1, 2, 4, 8 ]
33
34   substitution_mappings:
35     node_type: example.DatabaseSubsystem
36     capabilities:
37       database_endpoint: [ db_app, database_endpoint ]
38
39   node_templates:
40     db_app:
41       type: tosca.nodes.Database
42       properties:
43         user: { get_input: db_user }
44         port: { get_input: db_port }
45         name: { get_input: db_name }
46       capabilities:
47         database_endpoint:
48           properties:
49             port: 1234
50       requirements:
51         - host:
52             node: dbms
53
54     dbms:
55       type: tosca.nodes.DBMS
56       properties:
57         port: 3306
58         root_password: 123456789
59       requirements:
60         - host:
61             node: server
62
63     server:
64       type: tosca.nodes.Compute
65       capabilities:
66         host:
67           properties:
68             disk_size: 10 GB
69             num_cpus: { get_input: my_cpus }
70             mem_size: 4096 MB
71         os:
72           properties:
73             architecture: x86_64
74             type: Linux
75             distribution: Ubuntu
76             version: 14.04
77
78   outputs:
79     receiver_ip:
80       description: private IP address of the database application
81       value: { get_attribute: [ server, private_address ] }
82 # It seems current _process_intrisic_function can not handle more than 2 arguments, save it for later
83 #    receiver_port:
84 #      description: Port of the message receiver endpoint
85 #      value: { get_attribute: [ app, data_endpoint, port_name ] }
86
87   groups:
88     dbserver_group:
89       members: [ dbms, server ]
90       type: tosca.groups.Root