Add database subsystem definition in the use case of
[parser.git] / tosca2heat / tosca-parser / toscaparser / tests / data / tosca_elk.yaml
1 tosca_definitions_version: tosca_simple_yaml_1_0
2
3 description: >
4   This TOSCA simple profile deploys nodejs, mongodb, elasticsearch, logstash
5   and kibana each on a separate server with monitoring enabled for nodejs
6   server where a sample nodejs application is running. The rsyslog and collectd
7   are installed on a nodejs server.
8
9 imports:
10   - custom_types/paypalpizzastore_nodejs_app.yaml
11   - custom_types/elasticsearch.yaml
12   - custom_types/logstash.yaml
13   - custom_types/kibana.yaml
14   - custom_types/collectd.yaml
15   - custom_types/rsyslog.yaml
16
17 dsl_definitions:
18     host_capabilities: &host_capabilities
19       disk_size: 10 GB
20       num_cpus: { get_input: my_cpus }
21       mem_size: 4096 MB
22     os_capabilities: &os_capabilities
23       architecture: x86_64
24       type: Linux
25       distribution: Ubuntu
26       version: 14.04
27
28 topology_template:
29   inputs:
30     my_cpus:
31       type: integer
32       description: Number of CPUs for the server.
33       constraints:
34         - valid_values: [ 1, 2, 4, 8 ]
35       default: 1
36     github_url:
37        type: string
38        description: The URL to download nodejs.
39        default: http://github.com/paypal/rest-api-sample-app-nodejs.git
40
41   node_templates:
42     paypal_pizzastore:
43       type: tosca.nodes.WebApplication.PayPalPizzaStore
44       properties:
45           github_url: { get_input: github_url }
46       requirements:
47         - host: nodejs
48         - database_connection: mongo_db
49       interfaces:
50         Standard:
51            configure:
52              implementation: nodejs/config.sh
53              inputs:
54                github_url: { get_property: [ SELF, github_url ] }
55                mongodb_ip: { get_attribute: [mongo_server, private_address] }
56            start: nodejs/start.sh
57     nodejs:
58       type: tosca.nodes.WebServer
59       requirements:
60         - host: app_server
61       interfaces:
62         Standard:
63           create: nodejs/create.sh
64     mongo_db:
65       type: tosca.nodes.Database
66       requirements:
67         - host: mongo_dbms
68       interfaces:
69         Standard:
70           create: mongodb/create_database.sh
71     mongo_dbms:
72       type: tosca.nodes.DBMS
73       requirements:
74         - host: mongo_server
75       interfaces:
76         Standard:
77           create: mongodb/create.sh
78           configure:
79             implementation: mongodb/config.sh
80             inputs:
81               mongodb_ip: { get_attribute: [mongo_server, private_address] }
82           start: mongodb/start.sh
83     elasticsearch:
84       type: tosca.nodes.SoftwareComponent.Elasticsearch
85       requirements:
86         - host: elasticsearch_server
87       interfaces:
88         Standard:
89           create: elasticsearch/create.sh
90           start: elasticsearch/start.sh
91     logstash:
92       type: tosca.nodes.SoftwareComponent.Logstash
93       requirements:
94         - host: logstash_server
95         - search_endpoint:
96             node: elasticsearch
97             capability: search_endpoint
98             relationship:
99               type: tosca.relationships.ConnectsTo
100               interfaces:
101                 Configure:
102                   pre_configure_source:
103                     implementation: logstash/configure_elasticsearch.py
104                     inputs:
105                       elasticsearch_ip: { get_attribute: [elasticsearch_server, private_address] }
106       interfaces:
107         Standard:
108           create: logstash/create.sh
109           start: logstash/start.sh
110     kibana:
111       type: tosca.nodes.SoftwareComponent.Kibana
112       requirements:
113         - host: kibana_server
114         - search_endpoint: elasticsearch
115       interfaces:
116         Standard:
117           create: kibana/create.sh
118           configure:
119             implementation: kibana/config.sh
120             inputs:
121               elasticsearch_ip: { get_attribute: [elasticsearch_server, private_address] }
122               kibana_ip: { get_attribute: [kibana_server, private_address] }
123           start: kibana/start.sh
124     app_collectd:
125       type: tosca.nodes.SoftwareComponent.Collectd
126       requirements:
127         - host: app_server
128         - log_endpoint:
129             node: logstash
130             capability: log_endpoint
131             relationship:
132               type: tosca.relationships.ConnectsTo
133               interfaces:
134                 Configure:
135                   pre_configure_target:
136                     implementation: logstash/configure_collectd.py
137       interfaces:
138         Standard:
139           create: collectd/create.sh
140           configure:
141             implementation: collectd/config.py
142             inputs:
143               logstash_ip: { get_attribute: [logstash_server, private_address] }
144           start: collectd/start.sh
145     app_rsyslog:
146       type: tosca.nodes.SoftwareComponent.Rsyslog
147       requirements:
148         - host: app_server
149         - log_endpoint:
150             node: logstash
151             capability: log_endpoint
152             relationship:
153               type: tosca.relationships.ConnectsTo
154               interfaces:
155                 Configure:
156                   pre_configure_target:
157                     implementation: logstash/configure_rsyslog.py
158       interfaces:
159         Standard:
160           create: rsyslog/create.sh
161           configure:
162             implementation: rsyslog/config.sh
163             inputs:
164               logstash_ip: { get_attribute: [logstash_server, private_address] }
165           start: rsyslog/start.sh
166     app_server:
167       type: tosca.nodes.Compute
168       capabilities:
169         host:
170           properties: *host_capabilities
171         os:
172           properties: *os_capabilities
173     mongo_server:
174       type: tosca.nodes.Compute
175       capabilities:
176         host:
177           properties: *host_capabilities
178         os:
179           properties: *os_capabilities
180     elasticsearch_server:
181       type: tosca.nodes.Compute
182       capabilities:
183         host:
184           properties: *host_capabilities
185         os:
186           properties: *os_capabilities
187     logstash_server:
188       type: tosca.nodes.Compute
189       capabilities:
190         host:
191           properties: *host_capabilities
192         os:
193           properties: *os_capabilities
194     kibana_server:
195       type: tosca.nodes.Compute
196       capabilities:
197         host:
198           properties: *host_capabilities
199         os:
200           properties: *os_capabilities
201
202   outputs:
203     nodejs_url:
204       description: URL for the nodejs server, http://<IP>:3000
205       value: { get_attribute: [ app_server, private_address ] }
206     mongodb_url:
207       description: URL for the mongodb server.
208       value: { get_attribute: [ mongo_server, private_address ] }
209     elasticsearch_url:
210       description: URL for the elasticsearch server.
211       value: { get_attribute: [ elasticsearch_server, private_address ] }
212     logstash_url:
213       description: URL for the logstash server.
214       value: { get_attribute: [ logstash_server, private_address ] }
215     kibana_url:
216       description: URL for the kibana server.
217       value: { get_attribute: [ kibana_server, private_address ] }