blob: eb1ef93f5c236b6af9521b12541940ef8976784a (
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
|
<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='optical-service' version='${project.version}'>
<method rpc='inter-domain-handling' mode='sync'>
<block atomic="true">
<get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
resource="logical-links"
key=" "
pfx='inter' local-only='false' >
<outcome value='not-found'>
<return status='failure'>
<parameter name='error-code' value='500' />
<parameter name='error-message' value='No inter-domain-links available' />
<parameter name='ack-final-indicator' value="Y" />
</return>
</outcome>
<outcome value='failure'>
<return status='failure'>
<parameter name='error-code' value='500' />
<parameter name='error-message' value='Could not retrieve logical-links' />
<parameter name='ack-final-indicator' value="Y" />
</return>
</outcome>
<outcome value='success'>
<block atomic="true">
<for index='ida' start='0' end='`$inter.logical-link_length`' >
<switch test='`$inter.logical-link[$ida].link-type`'>
<outcome value='inter-domain'>
<switch test='`$inter.logical-link[$ida].available-capacity == 0`'>
<outcome value='true'></outcome>
<outcome value='false'>
<block atomic="true">
<set>
<parameter name='access-bend' value='`$inter.logical-link[$ida].relationship-list.relationship[0].relationship-data[1].relationship-value`' />
<parameter name='access-cend' value='`$inter.logical-link[$ida].relationship-list.relationship[1].relationship-data[1].relationship-value`' />
</set>
<break/>
</block>
</outcome>
</switch>
</outcome>
</switch>
</for>
<record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
<parameter name="file" value="/opt/opendaylight/current/data/log/inter-domain.log" />
<parameter name="level" value="info" />
<parameter name="field1" value="`'Aaccess bend---' + $access-bend`"/>
<parameter name="field2" value="`'Aaccess cend---' + $access-cend`"/>
<parameter name="field3" value="`'Service 1 req id---' + $service1-request-id`"/>
<parameter name="field4" value="`'Service 2 req id---' + $service2-request-id`"/>
</record>
<switch test="`$access-bend == ''`">
<outcome value='true'>
<return status='failure'>
<parameter name='error-code' value='500' />
<parameter name='error-message' value='No inter-domain-links available' />
<parameter name='ack-final-indicator' value="Y" />
</return>
</outcome>
<outcome value='false'>
<block atomic="true">
<set>
<parameter name='access-service-name' value='`$optical-service-create-input.payload.service-name`' />
</set>
<for index='idb' start='0' end='2' >
<switch test='`$idb`'>
<outcome value='0'>
<block atomic="true">
<set>
<parameter name='optical-service-create-input.payload.service-aend.port-id' value='`$access-aend`' />
<parameter name='optical-service-create-input.payload.service-zend.port-id' value='`$access-bend`' />
<parameter name='optical-service-create-input.payload.service-name' value="`$access-service-name + '_' + 'MDONS-OTN-TAPI-1'`" />
<parameter name='domain-type' value="TAPI" />
<parameter name='optical-service-create-input.request-id' value="`$service1-request-id`" />
<parameter name='optical-service-create-input.service-id' value="`$service1-svc-instance-id`" />
</set>
<call module='optical-service' rpc='main-create' mode='sync' >
<outcome value='success'>
<block atomic="true">
<set>
<parameter name='service1-status' value='`$final-response-code`' />
</set>
<switch test='`$service1-status == 200`'>
<outcome value='true'>
<set>
<parameter name='service1' value='success' />
</set>
</outcome>
<outcome value='false'>
<set>
<parameter name='service1' value='failure' />
</set>
</outcome>
</switch>
</block>
</outcome>
<outcome value='failure'>
<return status='failure'>
<parameter name='error-code' value='500' />
<parameter name='error-message' value='Main Create Dg not available' />
<parameter name='ack-final-indicator' value="Y" />
</return>
</outcome>
</call>
</block>
</outcome>
<outcome value='1'>
<block atomic="true">
<set>
<parameter name='optical-service-create-input.payload.service-aend.port-id' value='`$access-cend`' />
<parameter name='optical-service-create-input.payload.service-zend.port-id' value='`$access-zend`' />
<parameter name='optical-service-create-input.payload.service-name' value="`$access-service-name + '_' + 'MDONS-OTN-TAPI-2'`" />
<parameter name='domain-type' value="TAPI" />
<parameter name='optical-service-create-input.request-id' value="`$service2-request-id`" />
<parameter name='optical-service-create-input.service-id' value="`$service2-svc-instance-id`" />
</set>
<call module='optical-service' rpc='main-create' mode='sync' >
<outcome value='success'>
<block atomic="true">
<set>
<parameter name='service2-status' value='`$final-response-code`' />
</set>
<switch test='`$service2-status == 200`'>
<outcome value='true'>
<set>
<parameter name='service2' value='success' />
</set>
</outcome>
<outcome value='false'>
<set>
<parameter name='service2' value='success' />
</set>
</outcome>
</switch>
</block>
</outcome>
<outcome value='failure'>
<return status='failure'>
<parameter name='error-code' value='500' />
<parameter name='error-message' value='Main Create Dg not available' />
<parameter name='ack-final-indicator' value="Y" />
</return>
</outcome>
</call>
</block>
</outcome>
</switch>
</for>
<set>
<parameter name='inter' value='' />
</set>
<switch test='`$service1 == $service2 == success`'>
<outcome value='true'>
<block>
<save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource'
resource='SQL'
key='UPDATE REQUEST_DETAILS SET status = "CREATED" WHERE request_id = $as-request-id'
force='true' pfx='save-result'></save>
<update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService'
force='true'
resource='logical-link'
key='logical-link.link-name = $inter.logical-link[$ida].link-name '
local-only='false'>
<parameter name='available-capacity' value='0' />
</update>
<call module='optical-service' rpc='create-service-relationship' mode='sync' ></call>
<return status='success'>
<parameter name='error-code' value='200' />
<parameter name='error-message' value='Multi-domain-service successfully created' />
<parameter name='ack-final-indicator' value="Y" />
</return>
</block>
</outcome>
<outcome value='false'>
<block>
<record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
<parameter name="file" value="/opt/opendaylight/current/data/log/inter-domain.log" />
<parameter name="level" value="info" />
<parameter name="field1" value="Access service creation failed"/>
</record>
<return status='failure'>
<parameter name='error-code' value='500' />
<parameter name='error-message' value='Multi-domain-service creation failed' />
<parameter name='ack-final-indicator' value="Y" />
</return>
</block>
</outcome>
</switch>
</block>
</outcome>
</switch>
</block>
</outcome>
</get-resource>
</block>
</method>
</service-logic>
|