diff options
author | Lathish <lathishbabu.ganesan@est.tech> | 2020-08-06 10:25:41 +0100 |
---|---|---|
committer | Lathish <lathishbabu.ganesan@est.tech> | 2020-08-17 16:05:58 +0100 |
commit | 0e5d6a0a731db5f22921e3576ee9cbac6146b235 (patch) | |
tree | f04b253b7bde7109437054a23d3e0475f8bdbbf5 /platform-logic/a1Adapter-api/src/main/xml | |
parent | 7a6c02fe7cb42d7d0b65319bfd3a5996873cec52 (diff) |
Added Policy Type DG For A1 Mediation
Issue-ID: CCSDK-2605
Change-Id: If25d47ccd9d981e21b66a37c085c0c257644f47b
Signed-off-by: Lathish <lathishbabu.ganesan@est.tech>
Diffstat (limited to 'platform-logic/a1Adapter-api/src/main/xml')
-rw-r--r-- | platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getA1PolicyType.xml | 83 | ||||
-rw-r--r-- | platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getPolicyType.xml | 287 |
2 files changed, 83 insertions, 287 deletions
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 new file mode 100644 index 00000000..39908d81 --- /dev/null +++ b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getA1PolicyType.xml @@ -0,0 +1,83 @@ +<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> + <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> + <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="`$a1MediatorRsp.httpResponse`"/> + </record> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='ctxSetAttribute'> + <parameter name='object' value= "`$a1MediatorRsp.httpResponse`" /> + <parameter name='key' value='a1PolicyTypeResponse' /> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' > + <parameter name='filename' value='/opt/opendaylight/current/data/log/A1-Adapter-getPolicytype-specific-context.log' /> + </execute> + </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>
\ No newline at end of file diff --git a/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getPolicyType.xml b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getPolicyType.xml deleted file mode 100644 index 72eb3e27..00000000 --- a/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getPolicyType.xml +++ /dev/null @@ -1,287 +0,0 @@ -<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='getPolicyType' 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 from Near RT RIC ID"/> - <parameter name="field2" value="`$get-policy-type-input.near-rt-ric-id`"/> - <parameter name="field3" value="`$get-policy-type-input.policy-type-id`"/> - </record> - <set> - <parameter name='response-code' value='200' /> - <parameter name='response-message' value='getPolicyTypes 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> - <switch test='`$prop.ric-plt-A1Mediator-deployed`'> - <outcome value='true'> - <block atomic='true'> - <block atomic='true'> - <set> - <parameter name="tmp.near-rt-ric-id" value="`$get-policy-type-input.near-rt-ric-id`"/> - <parameter name="tmp.policy-type-id" value="`$get-policy-type-input.policy-type-id`"/> - </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="Setting variables for A1 Adapter Get Policy Type."/> - <parameter name="field2" value="`$tmp.near-rt-ric-id`"/> - <parameter name="field3" value="`$tmp.policy-type-id`"/> - </record> - <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > - <parameter name="source" value="`$prop.restapi.policytype`"/> - <parameter name="outputPath" value="tmp.restapi.policytype-url"/> - <parameter name="target" value="{policy_type_id}"/> - <parameter name="replacement" value="`$tmp.policy-type-id`"/> - </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="Setting variables for A1 Adapter Get Policy Type."/> - <parameter name="field2" value="`$tmp.near-rt-ric-id`"/> - <parameter name="field3" value="`$tmp.restapi.policytype-url`"/> - </record> - <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > - <parameter name="restapiUrl" value="`$prop.a1Mediator.url + '/' + $tmp.restapi.policytype-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> - <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="`$a1MediatorRsp.httpResponse`"/> - </record> - <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.payload"/> - <parameter name="target" value="\n"/> - <parameter name="replacement" value=""/> - <outcome value='success'> - <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="__TIMESTAMP__"/> - <parameter name="field2" value="Redndred template with lines removed \r"/> - <parameter name='field3' value='`$tmp.a1-mediator-restapi.payload`' /> - </record> - </block> - </outcome> - <outcome value='failure'> - <block></block> - </outcome> - </execute> - <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replaceAll' > - <parameter name="source" value="`$tmp.a1-mediator-restapi.payload`"/> - <parameter name="outputPath" value="tmp.a1-mediator-restapi.payload"/> - <parameter name="target" value="\t"/> - <parameter name="replacement" value=""/> - </execute> - <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='printContext' > - <parameter name='filename' value='/opt/opendaylight/current/data/log/A1-Adapter-getPolicytype-specific-context.log' /> - </execute> - </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 atomic='true'> - <set> - <parameter name='tmp.a1-adapter-api.rpc-name' value='getPolicyType'/> - <parameter name='tmp.a1Adapter-dmaap-resp.status-code' value='`$response-code`'/> - <parameter name='tmp.a1Adapter-dmaap-resp.status-value' value='`$response-message`'/> - <parameter name='tmp.a1Policy-dmaap-resp.payload' value='`$tmp.a1-mediator-restapi.payload`' /> - </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="__TIMESTAMP__"/> - <parameter name="field2" value="Before DMAAP Event - template file name, restapiURL"/> - <parameter name='field3' value="`$prop.restapi.templateDir + '/' + $prop.restapi.dmaap-publish-generic-response.template`" /> - <parameter name='field4' value="`$prop.dmaap-message-router.url + $prop.a1Adapter-dmaap-policy-response.topic`" /> - <parameter name='field5' value="Status Code and Status Value to be published" /> - <parameter name='field6' value="`$tmp.a1Adapter-dmaap-resp.status-code`" /> - <parameter name='field7' value="`$tmp.a1Adapter-dmaap-resp.status-value`" /> - <parameter name='field8' value="A1 Adapter DMAAP Response Payload" /> - <parameter name='field9' value="`$tmp.a1Policy-dmaap-resp.payload`" /> - <parameter name='field10' value="RPC Name" /> - <parameter name='field11' value="`$tmp.a1-adapter-api.rpc-name`" /> - </record> - <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > - <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.dmaap-publish-generic-response.template`" /> - <parameter name='restapiUrl' value="`$prop.dmaap-message-router.url + $prop.a1Adapter-dmaap-policy-response.topic`" /> - <parameter name='format' value='json' /> - <parameter name='httpMethod' value='POST' /> - <parameter name='contentType' value='application/json' /> - <parameter name='responsePrefix' value='dmaap' /> - <outcome value='failure'> - <block> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="response-code" value="500" /> - <parameter name="response-message" value="Error publishing DMAAP A1 Policy 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="DMAAP A1Policy message Successfully Published "/> - </record> - </block> - </outcome> - </execute> - </block> - </block> - </outcome> - </execute> - </block> - </block> - </outcome> - <outcome value='false'> - <block> - <set> - <parameter name='response-code' value='500'/> - <parameter name='response-message' value='A1 Mediator Not Deployed'/> - </set> - <block atomic='true'> - <set> - <parameter name='tmp.a1-adapter-api.rpc-name' value='getPolicyType'/> - <parameter name='tmp.a1Adapter-dmaap-resp.status-code' value='`$response-code`'/> - <parameter name='tmp.a1Adapter-dmaap-resp.status-value' value='`$response-message`'/> - <parameter name='tmp.a1Policy-dmaap-resp.payload' value='`$tmp.a1-mediator-restapi.payload`' /> - </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="__TIMESTAMP__"/> - <parameter name="field2" value="Before DMAAP Event - template file name, restapiURL"/> - <parameter name='field3' value="`$prop.restapi.templateDir + '/' + $prop.restapi.dmaap-publish-generic-response.template`" /> - <parameter name='field4' value="`$prop.dmaap-message-router.url + $prop.a1Adapter-dmaap-policy-response.topic`" /> - <parameter name='field5' value="Status Code and Status Value to be published" /> - <parameter name='field6' value="`$tmp.a1Adapter-dmaap-resp.status-code`" /> - <parameter name='field7' value="`$tmp.a1Adapter-dmaap-resp.status-value`" /> - <parameter name='field8' value="A1 Adapter DMAAP Response Payload" /> - <parameter name='field9' value="`$tmp.a1Policy-dmaap-resp.payload`" /> - <parameter name='field10' value="RPC Name" /> - <parameter name='field11' value="`$tmp.a1-adapter-api.rpc-name`" /> - </record> - <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > - <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.dmaap-publish-generic-response.template`" /> - <parameter name='restapiUrl' value="`$prop.dmaap-message-router.url + $prop.a1Adapter-dmaap-policy-response.topic`" /> - <parameter name='format' value='json' /> - <parameter name='httpMethod' value='POST' /> - <parameter name='contentType' value='application/json' /> - <parameter name='responsePrefix' value='dmaap' /> - <outcome value='failure'> - <block> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="response-code" value="500" /> - <parameter name="response-message" value="Error publishing DMAAP A1 Policy 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="DMAAP A1Policy message Successfully Published "/> - </record> - </block> - </outcome> - </execute> - </block> - <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 Type. Aborting" /> - </return> - </block> - </outcome> - </switch> - <block> - <block atomic='true'> - <set> - <parameter name='tmp.a1-adapter-api.rpc-name' value='getPolicyType'/> - <parameter name='tmp.a1Adapter-dmaap-resp.status-code' value='`$response-code`'/> - <parameter name='tmp.a1Adapter-dmaap-resp.status-value' value='`$response-message`'/> - <parameter name='tmp.a1Policy-dmaap-resp.payload' value='`$tmp.a1-mediator-restapi.payload`' /> - </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="__TIMESTAMP__"/> - <parameter name="field2" value="Before DMAAP Event - template file name, restapiURL"/> - <parameter name='field3' value="`$prop.restapi.templateDir + '/' + $prop.restapi.dmaap-publish-generic-response.template`" /> - <parameter name='field4' value="`$prop.dmaap-message-router.url + $prop.a1Adapter-dmaap-policy-response.topic`" /> - <parameter name='field5' value="Status Code and Status Value to be published" /> - <parameter name='field6' value="`$tmp.a1Adapter-dmaap-resp.status-code`" /> - <parameter name='field7' value="`$tmp.a1Adapter-dmaap-resp.status-value`" /> - <parameter name='field8' value="A1 Adapter DMAAP Response Payload" /> - <parameter name='field9' value="`$tmp.a1Policy-dmaap-resp.payload`" /> - <parameter name='field10' value="RPC Name" /> - <parameter name='field11' value="`$tmp.a1-adapter-api.rpc-name`" /> - </record> - <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > - <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.dmaap-publish-generic-response.template`" /> - <parameter name='restapiUrl' value="`$prop.dmaap-message-router.url + $prop.a1Adapter-dmaap-policy-response.topic`" /> - <parameter name='format' value='json' /> - <parameter name='httpMethod' value='POST' /> - <parameter name='contentType' value='application/json' /> - <parameter name='responsePrefix' value='dmaap' /> - <outcome value='failure'> - <block> - <return status='failure'> - <parameter name='ack-final' value='Y'/> - <parameter name="response-code" value="500" /> - <parameter name="response-message" value="Error publishing DMAAP A1 Policy 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="DMAAP A1Policy message Successfully Published "/> - </record> - </block> - </outcome> - </execute> - </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 |