blob: 9d2a899bd486d747f29512c8f6f31d911130265c (
plain)
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
- transformation-for: nodeType # Transforms all Node Types that extend from a valid ONAP NodeType.
name: Node Type transformation
description: converts any node type that has/extends from the type tosca.nodes.nfv.PnfExtCp
properties:
nodeNamePrefix: "org.openecomp.resource.abstract."
query:
derived_from: tosca.nodes.nfv.PnfExtCp
conversions:
- query:
derived_from:
to-name: derived_from
to-value:
strategy: replace
from: tosca.nodes.nfv.PnfExtCp
to: org.openecomp.resource.cp.v2.extCP
- query:
version:
to-name: version
to-value:
strategy: copy
- query:
metadata:
to-name: metadata
to-value:
strategy: copy
- query:
description:
to-name: description
to-value:
strategy: copy
- query:
attributes:
to-name: attributes
to-value:
strategy: copy
- query:
properties:
to-name: properties
to-value:
strategy: copy
- query:
requirements:
to-name: requirements
to-value:
strategy: copy
- query:
capabilities:
to-name: capabilities
to-value:
strategy: copy
- query:
interfaces:
to-name: interfaces
to-value:
strategy: copy
- query:
artifacts:
to-name: artifacts
to-value:
strategy: copy
- transformation-for: customNodeType # Transforms all Customized Node Types that extend from a valid ONAP NodeType.
name: Custom Node Type transformation
description: converts any node type that has/extends from the type tosca.nodes.nfv.PnfExtCp
from: tosca.nodes.nfv.PnfExtCp
to: org.openecomp.resource.cp.v2.extCP
- transformation-for: nodeTemplate #block
name: PnfExtCp transformation #transformation name
description: converts any node template that has a type tosca.nodes.nfv.PnfExtCp #transformation description
query: # Block query. Searches for node_template(s) with the same attributes. Ignores the node_template name.
# Supports recursive structure of key (string): value (new map or string).
# Each lvl can contain more than one key that will be treated as an AND.
# Must have the same structure in the original node_template declaration, otherwise the node_template will not be found.
type: tosca.nodes.nfv.PnfExtCp
conversions: # List of conversions/transformations that will be applied to the node_template attributes.
- query: # Attribute query for "type". Finds one attribute inside the node_template(s) found with the block query.
# Supports recursive structure of key (string): value (new map or string).
# Each lvl can only contain one key.
# If the attribute is found, the transformation strategy defined in this element will be applied.
# Must have the same structure in the original node_template declaration, otherwise the attribute will not be found.
type:
to-name: type # New attribute name.
to-value:
# Replace transformation strategy: replaces the old value for a new one. Must have this structure.
strategy: replace # Transformation strategy name.
from: tosca.nodes.nfv.PnfExtCp # Original attribute value.
to: org.openecomp.resource.cp.v2.extCP # New attribute value.
- query: # Another attribute query. This time for "properties/layer_protocols"
properties:
layer_protocols:
to-name: ip_requirements
to-value:
# Replace in list strategy: replaces specific values of a list for new ones.
strategy: replaceInList
list: # List of values to be replaced
- from: ipv4 # Searches for "ipv4" value and...
to: #...replaces for the following map
assingment_method: dhcp
ip_version: 4
- from: ipv6 # Another list value search and replace
to:
assingment_method: dhcp
ip_version: 6
# When a TOSCA { get_input: provided-input-name } function is found, the "provided-input-name"
# will be converted using the "transformation-for: getInputFunction" with name "ipRequirements".
to-get-input: ipRequirements
- transformation-for: getInputFunction # Transforms inputs called by get_input TOSCA function.
name: ipRequirements # Transformation name, used to be referred by "to-get-input" transformation attribute.
description: converts IpRequirements inputs when called by a get_input TOSCA function
conversions: #this part works exactly the same as the correspondent node_template transformation declarations.
- query:
type:
to-name: type
to-value:
strategy: copy
- query:
description:
to-name: description
to-value:
strategy: copy
- query:
entry_schema:
type:
to-name: type
to-value:
strategy: replace
from: string
to: org.openecomp.datatypes.network.IpRequirements
- query:
default:
to-name: default
to-value:
strategy: replaceInList
list:
- from: ipv4
to:
assingment_method: dhcp
ip_version: 4
- from: ipv6
to:
assingment_method: dhcp
ip_version: 6
|