diff options
author | Lathish <lathishbabu.ganesan@est.tech> | 2021-09-06 16:10:50 +0100 |
---|---|---|
committer | Lathish <lathishbabu.ganesan@est.tech> | 2021-09-07 15:07:20 +0100 |
commit | f906377369016ed5d82dd1f458b4b8cdcc2778b7 (patch) | |
tree | 6a32d40a7a98b179d2ecf69d30d1fd5ea2a1a465 /platform-logic/a1Adapter-api/src/main/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')
5 files changed, 525 insertions, 503 deletions
diff --git a/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_deleteA1Policy.xml b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_deleteA1Policy.xml index 3f264e57..2c1e67f6 100644 --- a/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_deleteA1Policy.xml +++ b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_deleteA1Policy.xml @@ -1,121 +1,125 @@ -<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='deleteA1Policy' 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="Delete A1 Policy:"/> - <parameter name="field2" value="`$delete-a1-policy-input.near-rt-ric-url`"/> - </record> - <set> - <parameter name='response-code' value='200' /> - <parameter name='response-message' value='deletePolicy 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="`$delete-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="Delete 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="Delete 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="Delete 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 A1 Adapter Delete 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="DELETE"/> - <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> - <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 Delete Policy Information "/> - <parameter name="field2" value="`$a1MediatorRsp.httpResponse`"/> - </record> - <set> - <parameter name='body' value='`$a1MediatorRsp.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="404" /> - <parameter name="response-message" value="Error in Deleting 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='deletePolicyInstance 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='deleteA1Policy' 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="Delete A1 Policy:"/>
+ <parameter name="field2" value="`$delete-a1-policy-input.near-rt-ric-url`"/>
+ </record>
+ <set>
+ <parameter name='response-code' value='200' />
+ <parameter name='response-message' value='deletePolicy 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="`$delete-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="Delete 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="Delete 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="Delete 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 A1 Adapter Delete 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="DELETE"/>
+ <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>
+ <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 Delete Policy Information "/>
+ <parameter name="field2" value="`$a1MediatorRsp.httpResponse`"/>
+ <parameter name='field3' value='`$a1MediatorRsp.response-code`'/>
+ <parameter name='field4' value='`$a1MediatorRsp.response-message`'/>
+ </record>
+ <set>
+ <parameter name='body' value='`$a1MediatorRsp.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='deletePolicyInstance executed successfully'/>
+ <parameter name='ack-final' value='Y'/>
+ </return>
+ </block>
+ </block>
+ </method>
</service-logic>
\ No newline at end of file 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 diff --git a/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getA1PolicyStatus.xml b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getA1PolicyStatus.xml index 5750c528..fb68b0aa 100644 --- a/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getA1PolicyStatus.xml +++ b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getA1PolicyStatus.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='getA1PolicyStatus' 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 Status:"/> - <parameter name="field2" value="`$get-a1-policy-status-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-status-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="Get A1 Policy Status: 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="Get A1 Policy Status: 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="Get A1 Policy Status: 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 Status."/> - <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="true"/> - <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 Status "/> - <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="404" /> - <parameter name="response-message" value="Error in Getting A1 Policy Status. 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 Policy Status 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='getA1PolicyStatus' 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 Status:"/>
+ <parameter name="field2" value="`$get-a1-policy-status-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-status-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="Get A1 Policy Status: 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="Get A1 Policy Status: 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="Get A1 Policy Status: 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 Status."/>
+ <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="true"/>
+ <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 Status "/>
+ <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 Policy Status executed successfully'/>
+ <parameter name='ack-final' value='Y'/>
+ </return>
+ </block>
+ </block>
+ </method>
</service-logic>
\ No newline at end of file diff --git a/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getA1PolicyType.xml b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getA1PolicyType.xml index 41091e0a..70d1aa21 100644 --- a/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getA1PolicyType.xml +++ b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getA1PolicyType.xml @@ -1,128 +1,132 @@ -<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='getA1PolicyType' 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 Policy Type:"/> - <parameter name="field2" value="`$get-a1-policy-type-input.near-rt-ric-url`"/> - </record> - <set> - <parameter name='response-code' value='200' /> - <parameter name='response-message' value='getA1PolicyType 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-type-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="Get Policy Type: 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="Get Policy Type: 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="Get Policy Type: 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 Type."/> - <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="true"/> - <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 Policy Type 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="404" /> - <parameter name="response-message" value="Error in Getting A1 Policy Type. 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='A1 Adapter is healthy'/> - <parameter name='health-status' value='200'/> - <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='getA1PolicyType' 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 Policy Type:"/>
+ <parameter name="field2" value="`$get-a1-policy-type-input.near-rt-ric-url`"/>
+ </record>
+ <set>
+ <parameter name='response-code' value='200' />
+ <parameter name='response-message' value='getA1PolicyType 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-type-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="Get Policy Type: 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="Get Policy Type: 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="Get Policy Type: 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 Type."/>
+ <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="true"/>
+ <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 Policy Type 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='A1 Adapter is healthy'/>
+ <parameter name='health-status' value='200'/>
+ <parameter name='ack-final' value='Y'/>
+ </return>
+ </block>
+ </block>
+ </method>
</service-logic>
\ No newline at end of file diff --git a/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_putA1Policy.xml b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_putA1Policy.xml index 2f6abb89..a9afa852 100644 --- a/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_putA1Policy.xml +++ b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_putA1Policy.xml @@ -85,13 +85,13 @@ <outcome value='failure'> <block> <set> - <parameter name='response-code' value='500'/> - <parameter name='response-message' value='Seems A1 Mediator Not Healthy'/> + <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="404" /> - <parameter name="response-message" value="Error creating A1 Policy. Aborting A1 Policy creation" /> + <parameter name='response-code' value='`$a1MediatorRsp.response-code`'/> + <parameter name='response-message' value='`$a1MediatorRsp.response-message`'/> </return> </block> </outcome> @@ -101,7 +101,13 @@ <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> |