blob: 9038e67881337ec26b20fa8a290ec29aacb0ddfc (
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
<service-logic
xmlns='http://www.onap.org/sdnc/svclogic'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.onap.org/sdnc/svclogic ./svclogic.xsd' module='GENERIC-RESOURCE-API' version='${project.version}'>
<method rpc='self-serve-vfmodule-ra-assignment' mode='sync'>
<block atomic="true">
<execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="generateUUID" >
<parameter name="ctx-destination" value="tmp.return.generate.vnf-se-serv-uuid" />
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="generateUUID is failed" />
</return>
</outcome>
</execute>
<set>
<parameter name="cds" value="execution-service_process."/>
<parameter name="`$cds + 'commonHeader.requestId'`" value="`$tmp.return.generate.vnf-se-serv-uuid`"/>
<parameter name="resource-type" value="`$vf-module-topology-operation-input.vf-module-information.vf-module-type`" />
<parameter name="`$cds + 'commonHeader.subRequestId'`" value="`$vf-module-topology-operation-input.vf-module-information.vf-module-id`" />
<parameter name="`$cds + 'actionIdentifiers.actionName'`" value="resource-assignment"/>
<parameter name="responsePrefix" value="raAssign" />
<parameter name="`$cds + 'isNonAppend'`" value="true"/>
<parameter name="`$cds + 'commonHeader.originatorId'`" value="SDNC_DG"/>
<parameter name="`$cds + 'actionIdentifiers.mode'`" value="sync"/>
</set>
<switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`'>
<outcome value=''>
<set>
<parameter name='highnum' value='0' />
<parameter name='prehighnum' value='0'/>
</set>
</outcome>
<outcome value='Other'>
<set>
<parameter name='highnum' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' />
<parameter name='prehighnum' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-topology.vf-module-parameters.param_length`' />
</set>
</outcome>
</switch>
<for silentFailure='true' index='i' start='0' end='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param_length`' >
<switch test='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].name`'>
<outcome value='sdnc_model_name'>
<set>
<parameter name='tmp.sdnc-model-name' value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].value`' />
</set>
</outcome>
<outcome value='sdnc_model_version'>
<set>
<parameter name='tmp.sdnc-model-version' value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].value`' />
</set>
</outcome>
<outcome value='vf_module_label'>
<set>
<parameter name='tmp.vf-module-label' value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].value`' />
</set>
</outcome>
<outcome value='Other'>
<set>
<parameter name="tmp.config-name-value-other-payload" value="`$tmp.config-name-value-other-payload + '"' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].name + '":"' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$i].value + '",'`"/>
</set>
</outcome>
</switch>
</for>
<switch test="`$tmp.sdnc-model-name == '' or $tmp.sdnc-model-version == '' or $tmp.vf-module-label == ''`">
<outcome value='true'>
<block atomic="true">
<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT * from VF_MODEL WHERE customization_uuid = $vf-module-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid'
pfx='db1.vf-model'>
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error reading VF_MODEL table" />
</return>
</outcome>
<outcome value='not-found'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'No VF_MODEL found with customization_uuid = ' + $vf-module-topology-operation-input.vnf-information.onap-model-information.model-customization-uuid`" />
</return>
</outcome>
<outcome value='success'>
<set>
<parameter name='tmp.sdnc-model-name' value='`$db1.vf-model.sdnc-model-name`' />
<parameter name='tmp.sdnc-model-version' value='`$db1.vf-model.sdnc-model-version`' />
</set>
</outcome>
</get-resource>
<get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT vf_module_label from VF_MODULE_MODEL WHERE customization_uuid = $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid
AND vf_module_label is not null'
pfx='db1.vf-module-model'>
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error reading VF_MODULE_MODEL table" />
</return>
</outcome>
<outcome value='not-found'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'vf_module_label not found in VF_MODULE_MODEL WHERE customization_uuid = ' + $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid`" />
</return>
</outcome>
<outcome value='success'>
<set>
<parameter name='tmp.vf-module-label' value='`$db1.vf-module-model.vf-module-label`' />
</set>
</outcome>
</get-resource>
</block>
</outcome>
</switch>
<set>
<parameter name="tmp.config-name-value-payload4" value="`$tmp.config-name-value-other-payload + '"service-instance-id":"' + $vf-module-topology-operation-input.service-information.service-instance-id + '",'`"/>
<parameter name="tmp.config-name-value-payload5" value="`$tmp.config-name-value-payload4 + '"vnf-id":"' + $vf-module-topology-operation-input.vnf-information.vnf-id + '",'`"/>
<parameter name="tmp.config-name-value-payload6" value="`$tmp.config-name-value-payload5 + '"vf-module-model-customization-uuid":"' + $vf-module-topology-operation-input.vf-module-information.onap-model-information.model-customization-uuid + '",'`"/>
<parameter name="tmp.config-name-value-payload7" value="`$tmp.config-name-value-payload6 + '"vnf-model-customization-uuid":"' + $service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-information.onap-model-information.model-customization-uuid + '",'`"/>
<parameter name="tmp.config-name-value-payload8" value="`$tmp.config-name-value-payload7 + '"vf-module-id":"' + $vf-module-topology-operation-input.vf-module-information.vf-module-id + '",'`"/>
<parameter name="tmp.config-name-value-payload9" value="`$tmp.config-name-value-payload8 + '"aic-cloud-region":"' + $vf-module-topology-operation-input.vf-module-request-input.aic-cloud-region + '"'`"/>
</set>
<set>
<parameter name="tmp.json-payload" value="`'{' + $tmp.config-name-value-payload9 + '}'`" />
<parameter name="`$cds + 'actionIdentifiers.blueprintName'`" value='`$tmp.sdnc-model-name`' />
<parameter name="`$cds + 'actionIdentifiers.blueprintVersion'`" value='`$tmp.sdnc-model-version`' />
<parameter name="`$cds + 'payload.resource-assignment-request.template-prefix[0]'`" value='`$tmp.vf-module-label`' />
<parameter name="`$cds + 'payload.resource-assignment-request.resource-assignment-properties'`" value='`$tmp.json-payload`' />
</set>
<record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
<parameter name="logger" value="message-log"/>
<parameter name="field1" value="BEFORE BlueprintProcessingClient"/>
</record>
<execute plugin='org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode' method='sendRequest' >
<parameter name='restapiUrl' value="`$prop.cds.url + '/api/v1/execution-service/process'`" />
<parameter name='restapiUser' value='`$prop.cds.user`' />
<parameter name='restapiPassword' value='`$prop.cds.pwd`' />
<parameter name='dirPath' value="/opt/onap/sdnc/restconfapi/yang" />
<parameter name='format' value='json' />
<parameter name='httpMethod' value='POST' />
<parameter name="responsePrefix" value="raAssign" />
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error from ConfigAssignmentNode" />
</return>
</outcome>
<outcome value='not-found'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error from ConfigAssignmentNode" />
</return>
</outcome>
</execute>
<record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
<parameter name="logger" value="message-log"/>
<parameter name="field1" value="AFTER BlueprintProcessingClient"/>
</record>
<execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
<parameter name="source" value="`'raAssign.payload.resource-assignment-response.resolved-data.' + $tmp.vf-module-label`" />
<parameter name="outputPath" value="jsonContextPrefix" />
<parameter name="isEscaped" value="true" />
<outcome value='success'>
<call module='GENERIC-RESOURCE-API' rpc='self-serve-process-vfmodule-mapping-ra-response' mode='sync' ></call>
</outcome>
<outcome value='failure'>
<execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils" method="jsonStringToCtx">
<parameter name="source" value="`'raAssign.payload.resource-assignment-response.meshed-template.' + $tmp.vf-module-label`" />
<parameter name="outputPath" value="jsonContextPrefix" />
<parameter name="isEscaped" value="true" />
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Failed to parse RA respose from mapping or meshed-template" />
</return>
</outcome>
<outcome value='success'>
<call module='GENERIC-RESOURCE-API' rpc='self-serve-process-vfmodule-template-ra-response' mode='sync' ></call>
</outcome>
</execute>
</outcome>
</execute>
<record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
<parameter name="logger" value="message-log"/>
<parameter name="field1" value="DONE: vfmodule-ra-assignment"/>
</record>
<set>
<parameter name='pathname'
value="`'/var/tmp/ss-vfmodule-ra-assignment-' +
$service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-data.vf-module-information.vf-module-id + '.log'`" />
</set>
<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' >
<parameter name='filename' value='`$pathname`' />
</execute>
</block>
</method>
</service-logic>
|