blob: a9afa852c82666d9f2b53b509d4ab4b8e5484372 (
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
|
<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='A1-ADAPTER-API' version='${project.version}'>
<method rpc='putA1Policy' mode='sync'>
<block atomic='true'>
<record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
<parameter name="file" value="/opt/opendaylight/current/data/log/A1-Adapter.log" />
<parameter name="level" value="info" />
<parameter name="field1" value="Put A1 Policy :"/>
<parameter name="field2" value="`$put-a1-policy-input.near-rt-ric-url`"/>
<parameter name="field3" value="`$put-a1-policy-input.body`"/>
</record>
<set>
<parameter name='response-code' value='200' />
<parameter name='response-message' value='Put A1 Policy executed successfully' />
</set>
<execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
<parameter name='fileName' value='/opt/onap/ccsdk/data/properties/a1-adapter-api-dg.properties' />
<parameter name='contextPrefix' value='prop' />
</execute>
<block atomic='true'>
<set>
<parameter name="tmp.near-rt-ric-url" value="`$put-a1-policy-input.near-rt-ric-url`"/>
<parameter name="tmp.body" value="`$put-a1-policy-input.body`"/>
</set>
<block>
<set>
<parameter name="tmp.proxy-url" value="`$prop.a1Mediator.proxy.url`"/>
</set>
<record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
<parameter name="file" value="/opt/opendaylight/current/data/log/A1-Adapter.log" />
<parameter name="level" value="info" />
<parameter name="field1" value="Put A1 Policy: Check for proxy url: "/>
<parameter name="field2" value="`$tmp.proxy-url`"/>
</record>
<switch test='`$tmp.proxy-url`'>
<outcome value=''>
<record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
<parameter name="file" value="/opt/opendaylight/current/data/log/A1-Adapter.log" />
<parameter name="level" value="info" />
<parameter name="field1" value="Put A1 Policy: No proxy found on properties file "/>
</record>
</outcome>
<outcome value='Other'>
<block>
<execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split'>
<parameter name="original_string" value="`$tmp.near-rt-ric-url`" />
<parameter name="regex" value="/"/>
<parameter name="ctx_memory_result_key" value="tmp.near-rt-ric-url-splitList"/>
</execute>
<for index='idx' start='3' end="`$tmp.near-rt-ric-url-splitList_length`" >
<set>
<parameter name='tmp.proxy-url' value="`$tmp.proxy-url +'/' + $tmp.near-rt-ric-url-splitList[$idx] `" />
</set>
</for>
<record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
<parameter name="file" value="/opt/opendaylight/current/data/log/A1-Adapter.log" />
<parameter name="level" value="info" />
<parameter name="field1" value="Put A1 Policy: Url with proxy: "/>
<parameter name="field2" value="`$tmp.proxy-url`"/>
</record>
<set>
<parameter name="tmp.near-rt-ric-url" value="`$tmp.proxy-url`"/>
</set>
</block>
</outcome>
</switch>
</block>
<record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
<parameter name="file" value="/opt/opendaylight/current/data/log/A1-Adapter.log" />
<parameter name="level" value="info" />
<parameter name="field1" value="Setting variables for Put A1 Policy."/>
<parameter name="field2" value="`$tmp.near-rt-ric-url`"/>
<parameter name="field3" value="`$tmp.body`"/>
</record>
<execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
<parameter name="restapiUrl" value="`$tmp.near-rt-ric-url`"/>
<parameter name="format" value="json"/>
<parameter name="httpMethod" value="PUT"/>
<parameter name="responsePrefix" value="a1MediatorRsp"/>
<parameter name='contentType' value='application/json' />
<parameter name='accept' value='application/json' />
<parameter name="requestBody" value="`$tmp.body`"/>
<parameter name="convertResponse" value="false"/>
<outcome value='failure'>
<block>
<set>
<parameter name='response-code' value='`$a1MediatorRsp.response-code`'/>
<parameter name='response-message' value='`$a1MediatorRsp.response-message`'/>
</set>
<return status='failure'>
<parameter name='ack-final' value='Y'/>
<parameter name='response-code' value='`$a1MediatorRsp.response-code`'/>
<parameter name='response-message' value='`$a1MediatorRsp.response-message`'/>
</return>
</block>
</outcome>
<outcome value='success'>
<block>
<record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
<parameter name="file" value="/opt/opendaylight/current/data/log/A1-Adapter.log" />
<parameter name="level" value="info" />
<parameter name="field1" value="A1 Policy Instance Created."/>
<parameter name='field2' value='`$a1MediatorRsp.response-code`'/>
<parameter name='field3' value='`$a1MediatorRsp.response-message`'/>
</record>
<set>
<parameter name='response-code' value='`$a1MediatorRsp.response-code`'/>
<parameter name='response-message' value='`$a1MediatorRsp.response-message`'/>
</set>
</block>
</outcome>
</execute>
</block>
</block>
</method>
</service-logic>
|