c31a4da5f745fa9375c53516d1c59a11facd5bbc
[parser.git] /
1 tosca_definitions_version: tosca_simple_yaml_1_0
2
3 description: >
4   TOSCA simple profile with server and attached block storage using a named Relationship Template for the storage attachment.
5
6 topology_template:
7   inputs:
8     cpus:
9       type: integer
10       description: Number of CPUs for the server.
11       constraints:
12         - valid_values: [ 1, 2, 4, 8 ]
13     storage_size:
14       type: scalar-unit.size
15       description: Size of the storage to be created.
16       default: 1 GB
17     storage_location:
18       type: string
19       description: Block storage mount point (filesystem path).
20
21   node_templates:
22     my_server:
23       type: Compute
24       capabilities:
25         host:
26           properties:
27             disk_size: 10 GB
28             num_cpus: { get_input: cpus }
29             mem_size: 4 MB
30         os:
31           properties:
32             architecture: x86_64
33             type: Linux
34             distribution: Fedora
35             version: 18.0
36       requirements:
37         - local_storage:
38             node: my_storage
39             # Declare template to use with 'relationship' keyword
40             relationship: storage_attachment
41
42     my_storage:
43       type: BlockStorage
44       properties:
45         size: { get_input: storage_size }
46
47   relationship_templates:
48     storage_attachment:
49       type: AttachesTo
50       properties:
51         location: { get_input: storage_location }
52
53   outputs:
54     private_ip:
55       description: The private IP address of the newly created compute instance.
56       value: { get_attribute: [my_server, private_address] }
57     volume_id:
58       description: The volume id of the block storage instance.
59       value: { get_attribute: [my_storage, volume_id] }