cb1c17aac62b159dc37590331036fef41a0fd388
[parser.git] /
1 tosca_definitions_version: tosca_simple_yaml_1_0
2
3 description: >
4   TOSCA simple profile with a single Block Storage node shared by 2-Tier Application with custom AttachesTo Type and explicit Relationship Templates.
5
6 relationship_types:
7   MyAttachesTo:
8     derived_from: tosca.relationships.AttachesTo
9     properties:
10       location:
11         type: string
12         default: /default_location
13
14 topology_template:
15   inputs:
16     cpus:
17       type: integer
18       description: Number of CPUs for the server.
19       constraints:
20         - valid_values: [ 1, 2, 4, 8 ]
21     storage_size:
22       type: scalar-unit.size
23       default: 1 GB
24       description: Size of the storage to be created.
25     storage_snapshot_id:
26       type: string
27       description: >
28         Optional identifier for an existing snapshot to use when creating storage.
29     storage_location:
30       type: string
31       description: >
32         Block storage mount point (filesystem path).
33
34   node_templates:
35
36     my_web_app_tier_1:
37       type: tosca.nodes.Compute
38       capabilities:
39         host:
40           properties:
41             disk_size: 10 GB
42             num_cpus: { get_input: cpus }
43             mem_size: 4096 kB
44         os:
45           properties:
46             architecture: x86_64
47             type: Linux
48             distribution: Fedora
49             version: 18.0
50       requirements:
51         - local_storage:
52             node: my_storage
53             relationship: storage_attachesto_1
54
55     my_web_app_tier_2:
56       type: tosca.nodes.Compute
57       capabilities:
58         host:
59           properties:
60             disk_size: 10 GB
61             num_cpus: { get_input: cpus }
62             mem_size: 4096 kB
63         os:
64           properties:
65             architecture: x86_64
66             type: Linux
67             distribution: Fedora
68             version: 18.0
69       requirements:
70         - local_storage:
71             node: my_storage
72             relationship: storage_attachesto_2
73
74     my_storage:
75       type: tosca.nodes.BlockStorage
76       properties:
77         size: { get_input: storage_size }
78         snapshot_id: { get_input: storage_snapshot_id }
79
80   relationship_templates:
81     storage_attachesto_1:
82       type: MyAttachesTo
83       properties:
84         location: /my_data_location
85
86     storage_attachesto_2:
87       type: MyAttachesTo
88       properties:
89         location: /some_other_data_location
90   outputs:
91     private_ip_1:
92       description: The private IP address of the application's first tier.
93       value: { get_attribute: [my_web_app_tier_1, private_address] }
94     private_ip_2:
95       description: The private IP address of the application's second tier.
96       value: { get_attribute: [my_web_app_tier_2, private_address] }
97     volume_id:
98       description: The volume id of the block storage instance.
99       value: { get_attribute: [my_storage, volume_id] }