blob: 6456f73b999e454fea3d846fb0e2b08ac86d51ff (
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
205
206
207
208
209
210
211
212
213
|
<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-generate-name-changeassign' mode='sync'>
<block atomic="true">
<switch test='`$ss.input.param.index`'>
<outcome value=''>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="ss.input.param.index is null" />
</return>
</outcome>
</switch>
<switch test='`$ss.service-data.param.index`'>
<outcome value=''>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="ss.service-data.param.index is null" />
</return>
</outcome>
</switch>
<switch test='`$ss.capability-type`'>
<outcome value='vnf'>
<block atomic='true'>
<for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.resource-key_length`' >
<switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.resource-key[$i].name`'>
<outcome value='external-key'>
<set>
<parameter name='tmp.external-key.value' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.resource-key[$i].value`' />
</set>
</outcome>
</switch>
</for>
<switch test='`$tmp.external-key.value`'>
<outcome value=''>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="self-service-generate-name-changeassign error : external-key is null for vnf" />
</return>
</outcome>
</switch>
<set>
<parameter name="tmp.vnf.changeassign.naming-data-payload" value="`'{"elements":[{' + '"resource-name":"' + $vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$ss.input.param.index].name + '","resource-value":"' + $vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$ss.input.param.index].value + '","external-key":"' + $tmp.external-key.value + '"}]}'`"/>
</set>
<execute plugin='org.openecomp.sdnc.prov.namegeneration.node.AssignNameNode' method='process'>
<parameter name='payload' value='`$tmp.vnf.changeassign.naming-data-payload`' />
<parameter name="prifix" value="vnf.changeassign.nameGenResponse" />
<outcome value='failure'>
<block atomic='true'>
<set>
<parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
</set>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'Error from NameGenerationNode ChangeAssign vnf ' + $error-message`" />
</return>
</block>
</outcome>
<outcome value='not-found'>
<block atomic='true'>
<set>
<parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
</set>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'Error from NameGenerationNode ChangeAssign vnf ' + $error-message`" />
</return>
</block>
</outcome>
</execute>
<update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="generic-vnf"
key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id " >
<parameter name="vnf-name" value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$ss.input.param.index].value`' />
<outcome value='failure'>
<block atomic='true'>
<set>
<parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
</set>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'Failed to update generic-vnf.vnf-name to ' + $ss.changeassign.vnf-name + ' in AnAI'`" />
</return>
</block>
</outcome>
<outcome value='not-found'>
<block atomic='true'>
<set>
<parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
</set>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'Failed to update generic-vnf.vnf-name to ' + $ss.changeassign.vnf-name + ' in AnAI'`" />
</return>
</block>
</outcome>
</update>
<set>
<parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].value`' value='`$vnf-topology-operation-input.vnf-request-input.vnf-input-parameters.param[$ss.input.param.index].value`'/>
<parameter name='`service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.status`' value='SUCCESS' />
</set>
</block>
</outcome>
<outcome value='vf-module'>
<block atomic='true'>
<for index='i' start='0' end='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.resource-key_length`' >
<switch test='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.resource-key[$i].name`'>
<outcome value='external-key'>
<set>
<parameter name='tmp.external-key.value' value='`$service-data.vnfs.vnf[$vnf-index].vnf-data.vnf-topology.vnf-parameters-data.param[$ss.service-data.param.index].resource-resolution-data.resource-key[$i].value`' />
</set>
</outcome>
</switch>
</for>
<switch test='`$tmp.external-key.value`'>
<outcome value=''>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="self-service-generate-name-changeassign error : external-key is null for vf-module" />
</return>
</outcome>
</switch>
<set>
<parameter name="tmp.vf-module.changeassign.naming-data-payload" value="`'{"elements":[{' + '"resource-name":"' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$ss.input.param.index].name + '","resource-value":"' + $vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$ss.input.param.index].value + '","external-key":"' + $tmp.external-key.value + '"}]}'`"/>
</set>
<execute plugin='org.openecomp.sdnc.prov.namegeneration.node.AssignNameNode' method='process'>
<parameter name='payload' value='`$tmp.vf-module.changeassign.naming-data-payload`' />
<parameter name="prifix" value="vf-module.changeassign.nameGenResponse" />
<outcome value='failure'>
<block atomic='true'>
<set>
<parameter name='`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[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
</set>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'Error from NameGenerationNode ChangeAssign vf-module ' + $error-message`" />
</return>
</block>
</outcome>
<outcome value='not-found'>
<block atomic='true'>
<set>
<parameter name='`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[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
</set>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'Error from NameGenerationNode ChangeAssign vf-module ' + $error-message`" />
</return>
</block>
</outcome>
</execute>
<update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="vf-module" key="generic-vnf.vnf-id = $service-data.vnfs.vnf[$vnf-index].vnf-id AND vf-module.vf-module-id = $service-data.vnfs.vnf[$vnf-index].vnf-data.vf-modules.vf-module[$vf-module-index].vf-module-id " >
<parameter name="vf-module-name" value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$ss.input.param.index].value`' />
<outcome value='failure'>
<block atomic='true'>
<set>
<parameter name='`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[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
</set>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'Failed to update vf-module.vf-module-name to ' + $ss.changeassign.vf-module-name + ' in AnAI'`" />
</return>
</block>
</outcome>
<outcome value='not-found'>
<block atomic='true'>
<set>
<parameter name='`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[$ss.service-data.param.index].resource-resolution-data.status`' value='FAILED' />
</set>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="`'Failed to update vf-module.vf-module-name to ' + $ss.changeassign.vf-module-name + ' in AnAI'`" />
</return>
</block>
</outcome>
</update>
<set>
<parameter name='`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[$ss.service-data.param.index].value`' value='`$vf-module-topology-operation-input.vf-module-request-input.vf-module-input-parameters.param[$ss.input.param.index].value`'/>
<parameter name='`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[$ss.service-data.param.index].resource-resolution-data.status`' value='SUCCESS' />
</set>
</block>
</outcome>
<outcome value='Other'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="capability-type is not vnf or vf-module" />
</return>
</outcome>
<outcome value=''>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="capability-type is not vnf or vf-module" />
</return>
</outcome>
</switch>
</block>
</method>
</service-logic>
|