tosca_definitions_version: tosca_simple_yaml_1.2
description: TOSCA simple profile for voting-app  extended with networks and volumes
topology_template:
node_templates:
vote: 
type: tosca.nodes.WebApplication.Vote
properties:
port: 5000:80
requirements:
- database_endpoint: redis
- host:app-server1
- host:app-server2
- local_storage:
node: data1
relationship:
type: tosca.relationships.AttachesTo
interfaces:
Standard:
Create: 
implementation:
primary: votingusecase/vote/app.py
dependencies: 
- votingusecase/vote/requirements.txt
result: 
type: tosca.nodes.WebApplication.Result
properties:
port: 5001:80
requirements:
- database_endpoint: postgres
- host:app-server1
- host:app-server2
-local_storage:
node: data2
relationship:
type: tosca.relationships.AttachesTo
interfaces:
Standard:
Create: 
implementation:
primary: votingusecase/result/server.js
dependencies: 
- votingusecase/result/package.json
worker: 
type: tosca.nodes.Container.Application.Docker
artifacts:
workerimage:
file: dockersamples/examplevotingapp_worker
type: tosca.artifacts.Deployment.Image.Container.Docker
repository: docker_hub
requirements:
- host:app-server2
- local_storage:
node:  data3
relationship:
type: tosca.relationships.AttachesTo
interfaces:
Standard:
Create: 
implementation: workerimage
postgres: 
type: tosca.nodes.Container.Application.Docker
artifacts:
postgresimage:
file: postgres:9.4
type: tosca.artifacts.Deployment.Image.Container.Docker
repository: docker_hub
requirements:
- host:app-server1
- host:app-server2
local_storage:
node:  data4
relationship:
type: tosca.relationships.AttachesTo
interfaces:
Standard:
Create: 
implementation: postgresimage
redis: 
type: tosca.nodes.Container.Application.Docker
artifacts:
redisimage:
file: redis:alpine
type: tosca.artifacts.Deployment.Image.Container.Docker
repository: docker_hub
requirements:
- host:app-server1
- host:app-server2
- local_storage:
node:  data5
relationship:
type: tosca.relationships.AttachesTo
interfaces:
Standard:
Create: 
implementation: redisimage
app-server1: 
type: tosca.nodes.Compute
capabilities:
host:
properties:
disk_size: 10 GB
num_cpus: 2
mem_size: 8 GB
OS:
properties:
architecture: x86_64
type: Linux
distribution: ubuntu
version: 12.04
app-server2: 
type: tosca.nodes.Compute
capabilities:
host:
properties:
disk_size: 10 GB
num_cpus: 2
mem_size: 8 GB
OS:
properties:
architecture: x86_64
type: Linux
distribution: ubuntu
version: 12.04
data1:
type: tosca.nodes.BlockStorage
properties:
size: 8 GB 
data2:
type: tosca.nodes.BlockStorage
properties:
size: 8 GB
data3:
type: tosca.nodes.BlockStorage
properties:
size: 5 GB
data4:
type: tosca.nodes.BlockStorage
properties:
size: 5 GB
data5:
type: tosca.nodes.BlockStorage
properties:
size: 5 GB
my_network1:
type: tosca.nodes.network.Network
properties:
network_name: networkfr
my_network2:
type: tosca.nodes.network.Network
properties:
network_name: networkbd
my_port1:
type: tosca.nodes.network.Port
requirements:
- binding: vote
- link: my_network1
my_port2:
type: tosca.nodes.network.Port
requirements:
- binding: result
- link: my_network1
my_port3:
type: tosca.nodes.network.Port
requirements:
- binding: worker
- link: my_network1
my_port4:
type: tosca.nodes.network.Port
requirements:
- binding:  postgres
- link: my_network2
my_port5:
type: tosca.nodes.network.Port
requirements:
- binding: redis
- link: my_network2


        
        
