-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathsubstitution-mapping.yaml
66 lines (52 loc) · 1.92 KB
/
substitution-mapping.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
tosca_definitions_version: tosca_simple_yaml_1_3
# Also see: substitution-mapping-client.yaml
metadata:
template_name: Substitution Mapping Example
template_author: Puccini
imports:
# (Make sure to take a look at the import)
- imports/super-load-balancer.yaml
topology_template:
inputs:
# This input is mapped to a property in "substitution_mappings"
# Thus, we do not have to give it a default value
# (even though it is a required input)
scale:
type: integer
node_templates:
loadbalancer:
type: tosca:LoadBalancer
# Both the WebServer and DBMS types derive from SoftwareComponent, meaning that they require a host
# So normally this service template would fail to parse due to unsatisfied requirements
# However, because we are mapping these in "substitution_mappings", Puccini will allow it
# (They are expected to be satisfied by a client service template)
admin:
type: tosca:WebServer
properties:
component_version: '1.0'
db:
type: tosca:DBMS
# Allow this entire service to be used as a single node
substitution_mappings:
node_type: SuperLoadBalancer
capabilities:
# Expose the internal loadbalancer node's capability
# The capability types must be compatible
client: [ loadbalancer, client ]
requirements:
# Expose the requirements of our software components
# Any requirement can be mapped
admin_host: [ admin, host ]
db_host: [ db, host ]
properties:
# Properties are mapped to inputs
# (You can also map properties to node template properties, though this use is deprecated in TOSCA 1.3)
# The data types must be compatible
redundancy: [ scale ]
attributes:
# The data types must be compatible
admin_state: [ admin, state ]
db_state: [ db, state ]
interfaces:
# The interface types must be compatible
Standard: [ admin, Standard ]