ORAN A1 Adapter DG Updates
[ccsdk/distribution.git] / platform-logic / a1Adapter-api / src / main / xml / A1-ADAPTER-API_getNearRT-RICs.xml
1 <service-logic
2     xmlns='http://www.onap.org/sdnc/svclogic'
3     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}'>
4     <method rpc='getNearRT-RICs' mode='sync'>
5         <block atomic='true'>
6             <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
7                 <parameter name="file" value="/opt/opendaylight/current/data/log/A1-Adapter.log" />
8                 <parameter name="level" value="info" />
9                 <parameter name="field1" value="A1 Adapter - get near-RT RIC Info"/>
10             </record>
11             <set>
12                 <parameter name='response-code' value='200' />
13                 <parameter name='response-message' value='A1 Mediator RIC ID available' />
14             </set>
15             <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
16                 <parameter name='fileName' value='/opt/onap/ccsdk/data/properties/a1-adapter-api-dg.properties' />
17                 <parameter name='contextPrefix' value='prop' />
18             </execute>
19             <switch test='`$prop.ric-plt-A1Mediator-deployed`'>
20                 <outcome value='true'>
21                     <block atomic='true'>
22                         <set>
23                             <parameter name="tmp.near-rt-ric-id" value="`$prop.near-rt-ric-id`"/>
24                         </set>
25                         <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
26                             <parameter name="file" value="/opt/opendaylight/current/data/log/A1-Adapter.log" />
27                             <parameter name="level" value="info" />
28                             <parameter name="field1" value="SNear-RT RIC ID"/>
29                             <parameter name="field2" value="`$tmp.near-rt-ric-id`"/>
30                         </record>
31                     </block>
32                 </outcome>
33                 <outcome value='false'>
34                     <block>
35                         <set>
36                             <parameter name='response-code' value='500'/>
37                             <parameter name='response-message' value='A1 Mediator Not Deployed'/>
38                         </set>
39                         <block atomic='true'>
40                             <set>
41                                 <parameter name='tmp.a1-adapter-api.rpc-name' value='getNearRT-RICs'/>
42                                 <parameter name='tmp.a1Adapter-dmaap-resp.status-code' value='`$response-code`'/>
43                                 <parameter name='tmp.a1Adapter-dmaap-resp.status-value' value='`$response-message`'/>
44                                 <parameter name='tmp.a1Policy-dmaap-resp.payload' value="`$tmp.near-rt-ric-id`" />
45                             </set>
46                             <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
47                                 <parameter name="file" value="/opt/opendaylight/current/data/log/A1-Adapter.log" />
48                                 <parameter name="level" value="info" />
49                                 <parameter name="field1" value="__TIMESTAMP__"/>
50                                 <parameter name="field2" value="Before DMAAP Event - template file name, restapiURL"/>
51                                 <parameter name='field3' value="`$prop.restapi.templateDir + '/' +  $prop.restapi.dmaap-publish-generic-response.template`" />
52                                 <parameter name='field4' value="`$prop.dmaap-message-router.url + $prop.a1Adapter-dmaap-policy-response.topic`" />
53                                 <parameter name='field5' value="Status Code and Status Value to be published" />
54                                 <parameter name='field6' value="`$tmp.a1Adapter-dmaap-resp.status-code`" />
55                                 <parameter name='field7' value="`$tmp.a1Adapter-dmaap-resp.status-value`" />
56                                 <parameter name='field8' value="A1 Adapter DMAAP Response Payload" />
57                                 <parameter name='field9' value="`$tmp.a1Policy-dmaap-resp.payload`" />
58                                 <parameter name='field10' value="RPC Name" />
59                                 <parameter name='field11' value="`$tmp.a1-adapter-api.rpc-name`" />
60                             </record>
61                             <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
62                                 <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' +  $prop.restapi.dmaap-publish-generic-response.template`" />
63                                 <parameter name='restapiUrl' value="`$prop.dmaap-message-router.url + $prop.a1Adapter-dmaap-policy-response.topic`" />
64                                 <parameter name='format' value='json' />
65                                 <parameter name='httpMethod' value='POST' />
66                                 <parameter name='contentType' value='application/json' />
67                                 <parameter name='responsePrefix' value='dmaap' />
68                                 <outcome value='failure'>
69                                     <block>
70                                         <return status='failure'>
71                                             <parameter name='ack-final' value='Y'/>
72                                             <parameter name="response-code" value="500" />
73                                             <parameter name="response-message" value="Error publishing DMAAP A1 Policy Response message. " />
74                                         </return>
75                                     </block>
76                                 </outcome>
77                                 <outcome value='success'>
78                                     <block>
79                                         <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
80                                             <parameter name="file" value="/opt/opendaylight/current/data/log/A1-Adapter.log" />
81                                             <parameter name="level" value="info" />
82                                             <parameter name="field1" value="DMAAP A1Policy message Successfully Published "/>
83                                         </record>
84                                     </block>
85                                 </outcome>
86                             </execute>
87                         </block>
88                         <return status='failure'>
89                             <parameter name='ack-final' value='Y'/>
90                             <parameter name="response-code" value="500" />
91                             <parameter name="response-message" value="A1 Mediator Not Deployed. Aborting Health Check" />
92                         </return>
93                     </block>
94                 </outcome>
95             </switch>
96             <block>
97                 <block atomic='true'>
98                     <set>
99                         <parameter name='tmp.a1-adapter-api.rpc-name' value='getNearRT-RICs'/>
100                         <parameter name='tmp.a1Adapter-dmaap-resp.status-code' value='`$response-code`'/>
101                         <parameter name='tmp.a1Adapter-dmaap-resp.status-value' value='`$response-message`'/>
102                         <parameter name='tmp.a1Policy-dmaap-resp.payload' value="`$tmp.near-rt-ric-id`" />
103                     </set>
104                     <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
105                         <parameter name="file" value="/opt/opendaylight/current/data/log/A1-Adapter.log" />
106                         <parameter name="level" value="info" />
107                         <parameter name="field1" value="__TIMESTAMP__"/>
108                         <parameter name="field2" value="Before DMAAP Event - template file name, restapiURL"/>
109                         <parameter name='field3' value="`$prop.restapi.templateDir + '/' +  $prop.restapi.dmaap-publish-generic-response.template`" />
110                         <parameter name='field4' value="`$prop.dmaap-message-router.url + $prop.a1Adapter-dmaap-policy-response.topic`" />
111                         <parameter name='field5' value="Status Code and Status Value to be published" />
112                         <parameter name='field6' value="`$tmp.a1Adapter-dmaap-resp.status-code`" />
113                         <parameter name='field7' value="`$tmp.a1Adapter-dmaap-resp.status-value`" />
114                         <parameter name='field8' value="A1 Adapter DMAAP Response Payload" />
115                         <parameter name='field9' value="`$tmp.a1Policy-dmaap-resp.payload`" />
116                         <parameter name='field10' value="RPC Name" />
117                         <parameter name='field11' value="`$tmp.a1-adapter-api.rpc-name`" />
118                     </record>
119                     <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
120                         <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' +  $prop.restapi.dmaap-publish-generic-response.template`" />
121                         <parameter name='restapiUrl' value="`$prop.dmaap-message-router.url + $prop.a1Adapter-dmaap-policy-response.topic`" />
122                         <parameter name='format' value='json' />
123                         <parameter name='httpMethod' value='POST' />
124                         <parameter name='contentType' value='application/json' />
125                         <parameter name='responsePrefix' value='dmaap' />
126                         <outcome value='failure'>
127                             <block>
128                                 <return status='failure'>
129                                     <parameter name='ack-final' value='Y'/>
130                                     <parameter name="response-code" value="500" />
131                                     <parameter name="response-message" value="Error publishing DMAAP A1 Policy Response message. " />
132                                 </return>
133                             </block>
134                         </outcome>
135                         <outcome value='success'>
136                             <block>
137                                 <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
138                                     <parameter name="file" value="/opt/opendaylight/current/data/log/A1-Adapter.log" />
139                                     <parameter name="level" value="info" />
140                                     <parameter name="field1" value="DMAAP A1Policy message Successfully Published "/>
141                                 </record>
142                             </block>
143                         </outcome>
144                     </execute>
145                 </block>
146                 <return status='success'>
147                     <parameter name="ack-final-indicator" value="Y" />
148                     <parameter name="error-code" value="200" />
149                     <parameter name="error-message" value="`$error-message`" />
150                     <parameter name='response-code' value='200' />
151                     <parameter name='response-message' value='A1 Mediatpor is available'/>
152                     <parameter name='health-status' value='200'/>
153                     <parameter name='ack-final' value='Y'/>
154                 </return>
155             </block>
156         </block>
157     </method>
158 </service-logic>

© 2017 ONAP. Copyright © The Linux Foundation ®. All Rights Reserved.
The Linux Foundation has registered trademarks and uses trademarks.
For a list of trademarks of The Linux Foundation, please see our Trademark Usage page.
Linux is a registered trademark of Linus Torvalds.
Privacy Policy and Terms of Use