Implement PNFD Model driven conversion
[sdc.git] / openecomp-be / lib / openecomp-tosca-converter-lib / openecomp-tosca-converter-core / src / test / resources / model-driven-conversion.yaml
1 - transformation-for: nodeTemplate #or "region: nodeTemplate"; or "object: nodeTemplate"
2   name: PnfExtCp transformation
3   description: converts any node template that has a type tosca.nodes.nfv.PnfExtCp
4   query: #or "find:"
5     #currently we only support a single attribute and value search. Can be hierarchical like "properties: layer_protocols:".
6     #must have the same structure in the original node_template declaration, otherwise the attribute will not be found.
7     type: tosca.nodes.nfv.PnfExtCp
8   conversions:
9     - query: #attribute query
10         #must have the same structure in the original node_template declaration, otherwise the attribute will not be found.
11         #the value does not matter as we are going to convert it.
12         type:
13       to-name: type #new attribute name. We could have a default strategy to copy the original name (in the query) if this entry is not provided.
14       to-value:
15         strategy: replace
16         from: tosca.nodes.nfv.PnfExtCp #could be ignored
17         to: org.openecomp.resource.cp.v2.extCP
18     - query:
19         properties:
20           layer_protocols:
21       to-name: ip_requirements
22       to-value:
23         strategy: replaceInList
24         list:
25           - from: ipv4
26             to:
27               assingment_method: dhcp
28               ip_version: 4
29           - from: ipv6
30             to:
31               assingment_method: dhcp
32               ip_version: 6
33       to-get-input: ipRequirements
34 - transformation-for: getInputFunction
35   name: ipRequirements
36   description: converts IpRequirements inputs when called by a get_input TOSCA function
37   conversions:
38     - query:
39         type:
40       to-name: type
41       to-value:
42         strategy: copy
43     - query:
44         description:
45       to-name: description
46       to-value:
47         strategy: copy
48     - query:
49         entry_schema:
50           type:
51       to-name: type
52       to-value:
53         strategy: replace
54         from: string
55         to: org.openecomp.datatypes.network.IpRequirements
56     - query:
57         default:
58       to-name: default
59       to-value:
60         strategy: replaceInList
61         list:
62           - from: ipv4
63             to:
64               assingment_method: dhcp
65               ip_version: 4
66           - from: ipv6
67             to:
68               assingment_method: dhcp
69               ip_version: 6