diff options
author | 2021-09-06 16:10:50 +0100 | |
---|---|---|
committer | 2021-09-07 15:07:20 +0100 | |
commit | f906377369016ed5d82dd1f458b4b8cdcc2778b7 (patch) | |
tree | 6a32d40a7a98b179d2ecf69d30d1fd5ea2a1a465 /platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getA1Policy.xml | |
parent | d39df59d0b50a60922ca790699cecc93258ed519 (diff) |
Bug Fix- Updated the http response code/ response message
Issue-ID: CCSDK-2828
Change-Id: Ifa65c7a75fdc00cb0db5fd34e3a42695bad3c4db
Signed-off-by: Lathish <lathishbabu.ganesan@est.tech>
Diffstat (limited to 'platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getA1Policy.xml')
-rw-r--r-- | platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getA1Policy.xml | 256 |
1 files changed, 130 insertions, 126 deletions
diff --git a/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getA1Policy.xml b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getA1Policy.xml index 2cedc9ca..e7d18878 100644 --- a/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getA1Policy.xml +++ b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getA1Policy.xml @@ -1,127 +1,131 @@ -<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='getA1Policy' 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="Get A1 Policy:"/> - <parameter name="field2" value="`$get-a1-policy-input.near-rt-ric-url`"/> - </record> - <set> - <parameter name='response-code' value='200' /> - <parameter name='response-message' value='Get 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="`$get-a1-policy-input.near-rt-ric-url`"/> - </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="A1 Get Policy Information: 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="A1 Get Policy Information: 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="A1 Get Policy Information: 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 A1 Adapter Get Policy Instance."/> - <parameter name="field2" value="`$tmp.near-rt-ric-url`"/> - </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="GET"/> - <parameter name="responsePrefix" value="a1MediatorRsp"/> - <parameter name='contentType' value='application/json' /> - <parameter name='accept' value='application/json' /> - <parameter name="convertResponse" value="false"/> - <outcome value='success'> - <block> - <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replaceAll' > - <parameter name="source" value="`$a1MediatorRsp.httpResponse`"/> - <parameter name="outputPath" value="tmp.a1-mediator-restapi.httpResponse"/> - <parameter name="target" value="\n"/> - <parameter name="replacement" value=""/> - </execute> - <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 Get Policy Information "/> - <parameter name="field2" value="`$tmp.a1-mediator-restapi.httpResponse`"/> - </record> - <set> - <parameter name='responseBody' value='`$tmp.a1-mediator-restapi.httpResponse`'/> - </set> - </block> - </outcome> - <outcome value='failure'> - <block> - <set> - <parameter name='response-code' value='500'/> - <parameter name='response-message' value='Seems A1 Mediator Not Healthy'/> - </set> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="response-code" value="500" /> - <parameter name="response-message" value="Error in Getting A1 Policy Instance. Aborting" /> - </return> - </block> - </outcome> - </execute> - </block> - <block> - <return status='success'> - <parameter name="ack-final-indicator" value="Y" /> - <parameter name="error-code" value="200" /> - <parameter name="error-message" value="`$error-message`" /> - <parameter name='response-code' value='200' /> - <parameter name='response-message' value='Get PolicyInstance executed successfully'/> - <parameter name='ack-final' value='Y'/> - </return> - </block> - </block> - </method> +<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='getA1Policy' 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="Get A1 Policy:"/>
+ <parameter name="field2" value="`$get-a1-policy-input.near-rt-ric-url`"/>
+ </record>
+ <set>
+ <parameter name='response-code' value='200' />
+ <parameter name='response-message' value='Get 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="`$get-a1-policy-input.near-rt-ric-url`"/>
+ </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="A1 Get Policy Information: 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="A1 Get Policy Information: 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="A1 Get Policy Information: 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 A1 Adapter Get Policy Instance."/>
+ <parameter name="field2" value="`$tmp.near-rt-ric-url`"/>
+ </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="GET"/>
+ <parameter name="responsePrefix" value="a1MediatorRsp"/>
+ <parameter name='contentType' value='application/json' />
+ <parameter name='accept' value='application/json' />
+ <parameter name="convertResponse" value="false"/>
+ <outcome value='success'>
+ <block>
+ <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replaceAll' >
+ <parameter name="source" value="`$a1MediatorRsp.httpResponse`"/>
+ <parameter name="outputPath" value="tmp.a1-mediator-restapi.httpResponse"/>
+ <parameter name="target" value="\n"/>
+ <parameter name="replacement" value=""/>
+ </execute>
+ <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 Get Policy Information "/>
+ <parameter name="field2" value="`$tmp.a1-mediator-restapi.httpResponse`"/>
+ <parameter name='field3' value='`$a1MediatorRsp.response-code`'/>
+ <parameter name='field4' value='`$a1MediatorRsp.response-message`'/>
+ </record>
+ <set>
+ <parameter name='responseBody' value='`$tmp.a1-mediator-restapi.httpResponse`'/>
+ <parameter name='response-code' value='`$a1MediatorRsp.response-code`'/>
+ <parameter name='response-message' value='`$a1MediatorRsp.response-message`'/>
+ </set>
+ </block>
+ </outcome>
+ <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>
+ </execute>
+ </block>
+ <block>
+ <return status='success'>
+ <parameter name="ack-final-indicator" value="Y" />
+ <parameter name="error-code" value="200" />
+ <parameter name="error-message" value="`$error-message`" />
+ <parameter name='response-code' value='200' />
+ <parameter name='response-message' value='Get PolicyInstance executed successfully'/>
+ <parameter name='ack-final' value='Y'/>
+ </return>
+ </block>
+ </block>
+ </method>
</service-logic>
\ No newline at end of file |