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