ORAN A1 Adapter DG Updates
[ccsdk/distribution.git] / platform-logic / a1Adapter-api / src / main / xml / A1-ADAPTER-API_notifyPolicyEnforcementUpdate.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='notifyPolicyEnforcementUpdate' 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 - notify policy enforcement update"/>
10                 <parameter name="field2" value="`$notify-policy-enforcement-update-input.near-rt-ric-id`"/>
11                 <parameter name="field3" value="`$notify-policy-enforcement-update-input.policy-type-id`"/>
12                 <parameter name="field4" value="`$notify-policy-enforcement-update-input.policy-instance-id`"/>
13             </record>
14             <set>
15                 <parameter name='response-code' value='200' />
16                 <parameter name='response-message' value='Policy Enforcement Update Received' />
17             </set>
18             <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
19                 <parameter name='fileName' value='/opt/onap/ccsdk/data/properties/a1-adapter-api-dg.properties' />
20                 <parameter name='contextPrefix' value='prop' />
21             </execute>
22             <set>
23                 <parameter name="tmp.near-rt-ric-id" value="`$notify-policy-enforcement-update-input.near-rt-ric-id`"/>
24                 <parameter name="tmp.policy-type-id" value="`$notify-policy-enforcement-update-input.policy-type-id`"/>
25                 <parameter name="tmp.policy-instance-id" value="`$notify-policy-enforcement-update-input.policy-instance-id`"/>
26             </set>
27             <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
28                 <parameter name="file" value="/opt/opendaylight/current/data/log/A1-Adapter.log" />
29                 <parameter name="level" value="info" />
30                 <parameter name="field1" value="SNear-RT RIC ID"/>
31                 <parameter name="field2" value="`$tmp.near-rt-ric-id`"/>
32                 <parameter name="field3" value="`$tmp.policy-type-id`"/>
33                 <parameter name="field4" value="`$tmp.policy-instance-id`"/>
34             </record>
35             <block atomic='true'>
36                 <set>
37                     <parameter name='tmp.a1-adapter-api.rpc-name' value='notifyPolicyEnforcementUpdate'/>
38                     <parameter name='tmp.a1Adapter-dmaap-resp.status-code' value='`$response-code`'/>
39                     <parameter name='tmp.a1Adapter-dmaap-resp.status-value' value='`$response-message`'/>
40                     <parameter name='tmp.a1Policy-dmaap-resp.payload' value="Policy Enforcement Update - Policies Applied" />
41                 </set>
42                 <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
43                     <parameter name="file" value="/opt/opendaylight/current/data/log/A1-Adapter.log" />
44                     <parameter name="level" value="info" />
45                     <parameter name="field1" value="__TIMESTAMP__"/>
46                     <parameter name="field2" value="Before DMAAP Event - template file name, restapiURL"/>
47                     <parameter name='field3' value="`$prop.restapi.templateDir + '/' +  $prop.restapi.dmaap-publish-generic-response.template`" />
48                     <parameter name='field4' value="`$prop.dmaap-message-router.url + $prop.a1Adapter-dmaap-policy-response.topic`" />
49                     <parameter name='field5' value="Status Code and Status Value to be published" />
50                     <parameter name='field6' value="`$tmp.a1Adapter-dmaap-resp.status-code`" />
51                     <parameter name='field7' value="`$tmp.a1Adapter-dmaap-resp.status-value`" />
52                     <parameter name='field8' value="A1 Adapter DMAAP Response Payload" />
53                     <parameter name='field9' value="`$tmp.a1Policy-dmaap-resp.payload`" />
54                     <parameter name='field10' value="RPC Name" />
55                     <parameter name='field11' value="`$tmp.a1-adapter-api.rpc-name`" />
56                 </record>
57                 <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
58                     <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' +  $prop.restapi.dmaap-publish-generic-response.template`" />
59                     <parameter name='restapiUrl' value="`$prop.dmaap-message-router.url + $prop.a1Adapter-dmaap-policy-response.topic`" />
60                     <parameter name='format' value='json' />
61                     <parameter name='httpMethod' value='POST' />
62                     <parameter name='contentType' value='application/json' />
63                     <parameter name='responsePrefix' value='dmaap' />
64                     <outcome value='failure'>
65                         <block>
66                             <return status='failure'>
67                                 <parameter name='ack-final' value='Y'/>
68                                 <parameter name="response-code" value="500" />
69                                 <parameter name="response-message" value="Error publishing DMAAP A1 Policy Response message. " />
70                             </return>
71                         </block>
72                     </outcome>
73                     <outcome value='success'>
74                         <block>
75                             <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
76                                 <parameter name="file" value="/opt/opendaylight/current/data/log/A1-Adapter.log" />
77                                 <parameter name="level" value="info" />
78                                 <parameter name="field1" value="DMAAP A1Policy message Successfully Published "/>
79                             </record>
80                         </block>
81                     </outcome>
82                 </execute>
83             </block>
84             <return status='success'>
85                 <parameter name="ack-final-indicator" value="Y" />
86                 <parameter name="error-code" value="200" />
87                 <parameter name="error-message" value="`$error-message`" />
88                 <parameter name='response-code' value='200' />
89                 <parameter name='response-message' value='Policy Enforcement Update Received'/>
90                 <parameter name='health-status' value='200'/>
91                 <parameter name='ack-final' value='Y'/>
92             </return>
93         </block>
94     </method>
95 </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