Update tosca lib to version 0.5
[parser.git] / tosca2heat / heat-translator / translator / 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:
115             node: elasticsearch
116             capability: search_endpoint
117       interfaces:
118         Standard:
119           create: kibana/create.sh
120           configure:
121             implementation: kibana/config.sh
122             inputs:
123               elasticsearch_ip: { get_attribute: [elasticsearch_server, private_address] }
124               kibana_ip: { get_attribute: [kibana_server, private_address] }
125           start: kibana/start.sh
126     app_collectd:
127       type: tosca.nodes.SoftwareComponent.Collectd
128       requirements:
129         - host: app_server
130         - log_endpoint:
131             node: logstash
132             capability: log_endpoint
133             relationship:
134               type: tosca.relationships.ConnectsTo
135               interfaces:
136                 Configure:
137                   pre_configure_target:
138                     implementation: logstash/configure_collectd.py
139       interfaces:
140         Standard:
141           create: collectd/create.sh
142           configure:
143             implementation: collectd/config.py
144             inputs:
145               logstash_ip: { get_attribute: [logstash_server, private_address] }
146           start: collectd/start.sh
147     app_rsyslog:
148       type: tosca.nodes.SoftwareComponent.Rsyslog
149       requirements:
150         - host: app_server
151         - log_endpoint:
152             node: logstash
153             capability: log_endpoint
154             relationship:
155               type: tosca.relationships.ConnectsTo
156               interfaces:
157                 Configure:
158                   pre_configure_target:
159                     implementation: logstash/configure_rsyslog.py
160       interfaces:
161         Standard:
162           create: rsyslog/create.sh
163           configure:
164             implementation: rsyslog/config.sh
165             inputs:
166               logstash_ip: { get_attribute: [logstash_server, private_address] }
167           start: rsyslog/start.sh
168     app_server:
169       type: tosca.nodes.Compute
170       capabilities:
171         host:
172           properties: *host_capabilities
173         os:
174           properties: *os_capabilities
175     mongo_server:
176       type: tosca.nodes.Compute
177       capabilities:
178         host:
179           properties: *host_capabilities
180         os:
181           properties: *os_capabilities
182     elasticsearch_server:
183       type: tosca.nodes.Compute
184       capabilities:
185         host:
186           properties: *host_capabilities
187         os:
188           properties: *os_capabilities
189     logstash_server:
190       type: tosca.nodes.Compute
191       capabilities:
192         host:
193           properties: *host_capabilities
194         os:
195           properties: *os_capabilities
196     kibana_server:
197       type: tosca.nodes.Compute
198       capabilities:
199         host:
200           properties: *host_capabilities
201         os:
202           properties: *os_capabilities
203
204   outputs:
205     nodejs_url:
206       description: URL for the nodejs server, http://<IP>:3000
207       value: { get_attribute: [ app_server, private_address ] }
208     mongodb_url:
209       description: URL for the mongodb server.
210       value: { get_attribute: [ mongo_server, private_address ] }
211     elasticsearch_url:
212       description: URL for the elasticsearch server.
213       value: { get_attribute: [ elasticsearch_server, private_address ] }
214     logstash_url:
215       description: URL for the logstash server.
216       value: { get_attribute: [ logstash_server, private_address ] }
217     kibana_url:
218       description: URL for the kibana server.
219       value: { get_attribute: [ kibana_server, private_address ] }