blob: 21f0efb45ae3b8616d081aa0c2c0e63191a5daa4 (
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
|
<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='brg-topology-operation-assign' mode='sync'>
<block atomic="true"><set>
<parameter name='tmp.ar.allotted-resource-id' value='`$brg-topology-operation-input.allotted-resource-information.allotted-resource-id`' />
<parameter name='tmp.ar.parent-service-instance-id' value='`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id`' />
</set><set>
<parameter name='tmp.ar.self-link' value="`'restconf/config/GENERIC-RESOURCE-API:tunnelxconn-allotted-resources/tunnelxconn-allotted-resource/'
+ $tmp.ar.allotted-resource-id
+ '/allotted-resource-data/tunnelxconn-topology/'` " />
</set><execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
<parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
<parameter name='contextPrefix' value='prop' />
</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
<parameter name="source" value="`$prop.restapi.brg-allottedresource`"/>
<parameter name="outputPath" value="tmp.ar-url"/>
<parameter name="target" value="{allotted-resource-id}"/>
<parameter name="replacement" value="`$tmp.ar.allotted-resource-id`"/>
</execute><get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.mdsal.ConfigResource' resource='GENERIC-RESOURCE-API' key='brg-allotted-resources/brg-allotted-resource/$brg-topology-operation-input.allotted-resource-information.allotted-resource-id/' pfx='mdsal-ar' >
<outcome value='Other'>
<block atomic="true">
<set>
<parameter name='brg-ar.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
<parameter name='brg-ar.allotted-resource-status.action' value="`$brg-topology-operation-input.request-information.request-action` " />
<parameter name='brg-ar.allotted-resource-status.rpc-name' value="brg-topology-operation" />
<parameter name='brg-ar.allotted-resource-status.rpc-action' value="`$brg-topology-operation-input.sdnc-request-header.svc-action` " />
<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.' value="`$brg-topology-operation-input.request-information.` " />
<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.' value="`$brg-topology-operation-input.sdnc-request-header.` " />
<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.service-information.' value="`$brg-topology-operation-input.service-information.` " />
<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.allotted-resource-information.' value="`$brg-topology-operation-input.allotted-resource-information.` " />
<parameter name='brg-ar.allotted-resource-data.allotted-resource-operation-information.tunnelxconn-request-input.' value="`$brg-topology-operation-input.brg-request-input.` " /></set><set>
<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.request-information.request-action`' />
<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-ar.allotted-resource-status.rpc-action`' />
<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-ar.allotted-resource-data.allotted-resource-operation-information.sdnc-request-header.svc-request-id`' />
</set><set>
<parameter name='brg-ar-identifiers.consuming-service-instance-id' value="`$brg-topology-operation-input.service-information.service-instance-id` " />
<parameter name='brg-ar-identifiers.parent-service-instance-id' value="`$brg-topology-operation-input.allotted-resource-information.parent-service-instance-id` " />
<parameter name='brg-ar-identifiers.allotted-resource-type' value="`$brg-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
<parameter name='brg-ar-identifiers.allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
</set><set>
<parameter name='tx-ar.allotted-resource-data.brg-topology.onap-model-information.'
value="`$brg-topology-operation-input.allotted-resource-information.onap-model-information.`" />
</set><switch test='$brg-topology-operation-input.allotted-resource-information.onap-model-information.model-invariant-uuid'>
<outcome value=''>
<set>
<parameter name='brg-ar.allotted-resource-data.brg-topology.onap-model-information.model-invariant-uuid'
value="`$ar-model.invariant-uuid`" />
</set></outcome></switch><switch test='$brg-topology-operation-input.allotted-resource-information.onap-model-information.model-uuid'>
<outcome value=''>
<set>
<parameter name='brg-ar.allotted-resource-data.brg-topology.onap-model-information.model-uuid'
value="`$ar-model.uuid`" />
</set></outcome></switch><switch test='$brg-topology-operation-input.allotted-resource-information.onap-model-information.model-version'>
<outcome value=''>
<set>
<parameter name='tx-ar.allotted-resource-data.tunnelxconn-topology.onap-model-information.model-version'
value="`$ar-model.version`" />
</set></outcome></switch><switch test='`$ar-model.ecomp-generated-naming`'>
<outcome value='Y'>
<block atomic="true">
<switch test='`$ar-model.naming-policy`'>
<outcome value='oam_network_policy'>
<block atomic='true'>
<set>
<parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' />
</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
<parameter name="source" value="`$tmp.ar-name`"/>
<parameter name="outputPath" value="tmp.ar-name"/>
<parameter name="target" value="$TenantOAMNetworkRole"/>
<parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.untrusted-network-role`"/>
</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
<parameter name="source" value="`$tmp.ar-name`"/>
<parameter name="outputPath" value="tmp.ar-name"/>
<parameter name="target" value="$LandingNetworkRole"/>
<parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.trusted-network-role`"/>
</execute><set>
<parameter name='brg-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
</set></block></outcome><outcome value='Other'>
<block atomic='true'>
<set>
<parameter name='tmp.ar-name' value='$TenantOAMNetworkRole_$LandingNetworkRole_SZ' />
</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
<parameter name="source" value="`$tmp.ar-name`"/>
<parameter name="outputPath" value="tmp.ar-name"/>
<parameter name="target" value="$TenantOAMNetworkRole"/>
<parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.untrusted-network-role`"/>
</execute><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
<parameter name="source" value="`$tmp.ar-name`"/>
<parameter name="outputPath" value="tmp.ar-name"/>
<parameter name="target" value="$LandingNetworkRole"/>
<parameter name="replacement" value="`$tunnelxconn-topology-operation-input.tunnelxconn-request-input.trusted-network-role`"/>
</execute><set>
<parameter name='brg-ar-identifiers.allotted-resource-name' value='`$tmp.ar-name`' />
</set></block></outcome></switch></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="Error in allotted-resource-model data. Ecomp-generated-naming should be true" />
</return></outcome></switch><set>
<parameter name='brg-ar.allotted-resource-data.brg-topology.allotted-resource-identifiers.'
value="`$brg-ar-identifiers.`" />
</set><set>
<parameter name='brg-ar-assignments.vbrg-wan-ip' value='127.0.0.1'/>
</set><set>
<parameter name='brg-ar.allotted-resource-data.brg-topology.brg-assignments.'
value="`$brg-ar-assignments.`" />
</set><switch test='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`'>
<outcome value=''>
<set>
<parameter name='tmp.cidx' value="`0`" />
<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value="1" />
</set></outcome><outcome value='Other'>
<block atomic="true"><for index='cidx' start='0' end='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' >
<switch test="`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].allotted-resource-id == $tmp.ar.allotted-resource-id`">
<outcome value='true'>
<block atomic="true"><set>
<parameter name='tmp.cidx' value='`$cidx`' />
<parameter name='ctx.consumed-ar.' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource[$cidx].`' />
<parameter name='tmp.found-cidx' value='true' /></set><break></break></block></outcome></switch></for><switch test='`$tmp.found-cidx`'>
<outcome value='false'>
<block atomic="true"><set>
<parameter name='tmp.cidx' value='`$service-data.consumed-allotted-resources.consumed-allotted-resource_length`' />
</set></block></outcome></switch></block></outcome></switch><set>
<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-id' value="`$tmp.ar.allotted-resource-id` " />
<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-type' value="`$brg-topology-operation-input.allotted-resource-information.allotted-resource-type` " />
<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource[$tmp.cidx].allotted-resource-pointer' value="`$tmp.ar.self-link` " />
<parameter name='service-data.consumed-allotted-resources.consumed-allotted-resource_length' value='`$tmp.cidx + 1`' />
</set><execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='setTime' >
<parameter name="outputPath" value="tmp.current-time" />
</execute><set>
<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.order-status' value='PendingCreate' />
<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-action' value='`$brg-topology-operation-input.request-information.request-action`' />
<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-rpc-action' value='`$brg-topology-operation-input.sdnc-request-header.svc-action`' />
<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.last-svc-request-id' value='`$brg-topology-operation-input.sdnc-request-header.svc-request-id`' />
<parameter name='brg-ar.allotted-resource-data.allotted-resource-oper-status.create-timestamp' value='`$tmp.current-time`' />
</set><update plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="allotted-resource"
key="customer.global-customer-id = $brg-topology-operation-input.service-information.global-customer-id AND
service-subscription.service-type = $brg-topology-operation-input.service-information.subscription-service-type AND
service-instance.service-instance-id = $brg-topology-operation-input.allotted-resource-information.parent-service-instance-id AND
allotted-resource.id = $tmp.ar.allotted-resource-id"
pfx='pfx' local-only='false' force='false'>
<parameter name="description" value="`$tunnelxconn-topology-operation-input.allotted-resource-information.allotted-resource-type`" />
<parameter name="selflink" value="`$tmp.ar.self-link`" />
<parameter name="model-invariant-id" value="`$ar-model.invariant-uuid`" />
<parameter name="model-version-id" value="`$ar-model.uuid`" />
<parameter name="operational-status" value="null" />
<outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="AAI failed" />
</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="AAI failed" />
</return></outcome></update><execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
<parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.brg.templatefile`" />
<parameter name='restapiUrl' value='`$prop.controller.url + $tmp.ar-url`' />
<parameter name='restapiUser' value='`$prop.controller.user`' />
<parameter name='restapiPassword' value='`$prop.controller.pwd`' />
<parameter name='format' value='json' />
<parameter name='httpMethod' value='PUT' />
<parameter name="responsePrefix" value="mdsal-ar" />
<outcome value='success'>
<block>
<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
<parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.parentsvc.templatefile`" />
<parameter name='restapiUrl' value='`$prop.controller.url + $tmp.parent-ar-url`' />
<parameter name='restapiUser' value='`$prop.controller.user`' />
<parameter name='restapiPassword' value='`$prop.controller.pwd`' />
<parameter name='format' value='json' />
<parameter name='httpMethod' value='DELETE' />
<parameter name="responsePrefix" value="parent" />
<outcome value='success'>
<block></block></outcome><outcome value='failure'>
<block></block></outcome><outcome value='not-found'>
<block></block></outcome></execute></block></outcome><outcome value='failure'>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name="error-code" value="500" />
<parameter name="error-message" value="Error updating md-sal for tunnelxconn-allotted-resource" />
</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 updating md-sal for tunnelxconn-allotted-resource" />
</return></outcome></execute><set>
<parameter name='allotted-resource-id' value='`$tmp.ar.allotted-resource-id`' />
<parameter name='tunnelxconn-object-path' value="`$tmp.ar.self-link`"/>
<parameter name='service-object-path' value="`'restconf/config/GENERIC-RESOURCE-API:services/service/'
+ $brg-topology-operation-input.service-information.service-instance-id
+ '/service-data/service-topology/'`"/>
</set><return status='success'>
<parameter name="ack-final-indicator" value="Y" />
<parameter name="error-code" value="200" />
<parameter name="error-message" value="`$error-message`" />
</return></block></outcome></get-resource></block></method></service-logic>
|