diff options
Diffstat (limited to 'platform-logic/a1Adapter-api/src/main/xml')
10 files changed, 3064 insertions, 6 deletions
diff --git a/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_createPolicyInstance.xml b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_createPolicyInstance.xml new file mode 100644 index 00000000..569c8db5 --- /dev/null +++ b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_createPolicyInstance.xml @@ -0,0 +1,470 @@ +<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='createPolicyInstance' 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="A1 Adapter Create Policy Instance. RPC Parms:"/> + <parameter name="field2" value="`$create-policy-instance-input.near-rt-ric-id`"/> + <parameter name="field3" value="`$create-policy-instance-input.policy-type-id`"/> + <parameter name="field4" value="`$create-policy-instance-input.policy-instance-id`"/> + <parameter name="field5" value="A1 Adapter Create Policy Instance. Number of Policy Properties"/> + <parameter name="field6" value="`$create-policy-instance-input.properties_length`"/> + </record> + <set> + <parameter name='response-code' value='200' /> + <parameter name='response-message' value='Successful execution of createPolicyInstance RPC' /> + </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> + <for index='idx' start='0' end='`$create-policy-instance-input.properties_length`' > + <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 Adapter Create Policy Instance. Properties Name and Value"/> + <parameter name="field2" value="`$idx`"/> + <parameter name="field3" value="`$create-policy-instance-input.properties[$idx].property-name`"/> + <parameter name="field4" value="`$create-policy-instance-input.properties[$idx].property-value`"/> + </record> + </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="Properties read .. A1 Mediator Target"/> + <parameter name="field2" value="`$prop.oofpcipoc.patch.pci.target`"/> + <parameter name="field3" value="`$prop.controller.user`"/> + <parameter name="field4" value="`$prop.controller.pwd`"/> + <parameter name="field5" value="`$prop.controller.url`"/> + <parameter name="field6" value="A1 Mediator deployed (true/false): "/> + <parameter name="field7" value="`$prop.ric-plt-A1Mediator-deployed`"/> + </record> + <switch test='`$prop.ric-plt-A1Mediator-deployed`'> + <outcome value='true'> + <block atomic='true'> + <block atomic='true'> + <execute plugin="org.onap.ccsdk.sli.plugins.template.TemplateNode" method="evaluateTemplate" > + <parameter name='templatePath' value='a1-policy-instance-property-payload-template.vtl' /> + <parameter name='output' value='restapi-payload' /> + <parameter name='prefix' value='a1-mediator' /> + <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 A1 Mediator RestAPI payload template as a string"/> + <parameter name='field3' value='`$a1-mediator.restapi-payload`' /> + </record> + </block> + </outcome> + <outcome value='failure'> + <block> + <set> + <parameter name='response-code' value='500'/> + <parameter name='response-message' value='Error creating A1 Mediator Rest API payload string. Aborting A1 Policy Instance creation'/> + </set> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="response-code" value="500" /> + <parameter name="response-message" value="Error creating A1 Mediatory Rest API payload string. Aborting A1 Policy Instance creation" /> + </return> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='createPolicyInstance'/> + <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="None" /> + </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 Not Required" /> + <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> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replaceAll' > + <parameter name="source" value="`$a1-mediator.restapi-payload`"/> + <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> + <set> + <parameter name='response-code' value='500'/> + <parameter name="response-message" value="Error removing lines from A1 Mediator Rest API payload string. Aborting A1 Policy Instance creation" /> + </set> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="response-code" value="500" /> + <parameter name="response-message" value="Error removing lines from A1 Mediator Rest API payload string. Aborting A1 Policy creation" /> + </return> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='createPolicyInstance'/> + <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="None" /> + </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 Not Required" /> + <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> + <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=""/> + <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 tabs removed \r"/> + <parameter name='field3' value='`$tmp.a1-mediator-restapi.payload`' /> + </record> + </block> + </outcome> + <outcome value='failure'> + <block> + <set> + <parameter name='response-code' value='500'/> + <parameter name="response-message" value="Error removing tabs from A1 Mediator Rest API payload string. Aborting A1 Policy Instance creation" /> + </set> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="response-code" value="500" /> + <parameter name="response-message" value="Error removing tabs from A1 Mediator Rest API payload string. Aborting A1 Policy creation" /> + </return> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='createPolicyInstance'/> + <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="None" /> + </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 Not Required" /> + <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 atomic='true'> + <set> + <parameter name="tmp.near-rt-ric-id" value="`$create-policy-instance-input.near-rt-ric-id`"/> + <parameter name="tmp.policy-type-id" value="`$create-policy-instance-input.policy-type-id`"/> + <parameter name="tmp.policy-instance-id" value="`$create-policy-instance-input.policy-instance-id`"/> + </set> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.policy`"/> + <parameter name="outputPath" value="tmp.restapi.policy-url"/> + <parameter name="target" value="{policy_type_id}"/> + <parameter name="replacement" value="`$tmp.policy-type-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.restapi.policy-url`"/> + <parameter name="outputPath" value="tmp.restapi.policy-url"/> + <parameter name="target" value="{policy_instance_id}"/> + <parameter name="replacement" value="`$tmp.policy-instance-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 Create Policy Instance."/> + <parameter name="field2" value="`$tmp.near-rt-ric-id`"/> + <parameter name="field3" value="`$tmp.policy-type-id`"/> + <parameter name="field4" value="`$tmp.policy-instance-id`"/> + <parameter name="field5" value="`$tmp.restapi.policy-url`"/> + <parameter name="field6" value="`$a1-mediator.restapi-payload`"/> + <parameter name="field7" value="Temporary A1 Mediatory Payload"/> + <parameter name="field8" value="`$tmp.a1-mediator-restapi.payload`"/> + </record> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name="restapiUrl" value="`$prop.a1Mediator.url + '/' + $tmp.restapi.policy-url`"/> + <parameter name="format" value="json"/> + <parameter name="httpMethod" value="PUT"/> + <parameter name="responsePrefix" value="a1MediatorRsp"/> + <parameter name='contentType' value='application/json' /> + <parameter name='accept' value='application/json' /> + <parameter name="requestBody" value="`$tmp.a1-mediator-restapi.payload`"/> + <parameter name="convertResponse" value="false"/> + <outcome value='failure'> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="response-code" value="404" /> + <parameter name="response-message" value="Error creating A1 Policy Instance. Aborting A1 Policy creation" /> + </return> + </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="A1 Policy Instance Accepted."/> + </record> + </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='createPolicyInstance'/> + <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="None" /> + </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 Not Required" /> + <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="A1 Mediator Not Deployed. Aborting A1 Policy creation" /> + </return> + </block> + </outcome> + </switch> + <block> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='createPolicyInstance'/> + <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="None" /> + </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 Not Required" /> + <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 diff --git a/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_createPolicyType.xml b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_createPolicyType.xml new file mode 100644 index 00000000..11b7c70d --- /dev/null +++ b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_createPolicyType.xml @@ -0,0 +1,534 @@ +<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='createPolicyType' 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="A1 Adapter Create Policy Type. RPC Parms:"/> + <parameter name="field2" value="`$create-policy-type-input.near-rt-ric-id`"/> + <parameter name="field3" value="`$create-policy-type-input.policy-type-id`"/> + <parameter name="field4" value="`$create-policy-type-input.description`"/> + <parameter name="field5" value="A1 Adapter Create Policy Type Name:"/> + <parameter name="field6" value="`$create-policy-type-input.name`"/> + <parameter name="field7" value="A1 Adapter Create Policy Type. Number of Policy Type Properties"/> + <parameter name="field8" value="`$create-policy-type-input.properties_length`"/> + </record> + <set> + <parameter name='response-code' value='200' /> + <parameter name='response-message' value='Successful execution of createPolicyType RPC' /> + </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> + <for index='idx1' start='0' end='`$create-policy-type-input.properties_length`' > + <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="A1 Adapter Create Policy Type. Properties Number, Name and Number of Policy Statements"/> + <parameter name="field2" value="`$idx1`"/> + <parameter name="field3" value="`$create-policy-type-input.properties[$idx1].property-name`"/> + <parameter name="field4" value="`$create-policy-type-input.properties[$idx1].policy-statements_length`"/> + </record> + <for index='idx2' start='0' end='`$create-policy-type-input.properties[$idx1].policy-statements_length`' > + <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 Adapter Create Policy Type. Policy Statements for policy statement # "/> + <parameter name="field2" value="`$idx2`"/> + <parameter name="field3" value="`$create-policy-type-input.properties[$idx1].policy-statements[$idx2].policy-statement`"/> + <parameter name="field4" value="`$create-policy-type-input.properties[$idx1].policy-statements[$idx2].policy-statement-value`"/> + </record> + </for> + </block> + </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="Properties read .. A1 Mediator Target"/> + <parameter name="field2" value="`$prop.oofpcipoc.patch.pci.target`"/> + <parameter name="field3" value="`$prop.controller.user`"/> + <parameter name="field4" value="`$prop.controller.pwd`"/> + <parameter name="field5" value="`$prop.controller.url`"/> + <parameter name="field6" value="A1 Mediator deployed (true/false): "/> + <parameter name="field7" value="`$prop.ric-plt-A1Mediator-deployed`"/> + </record> + <switch test='`$prop.ric-plt-A1Mediator-deployed`'> + <outcome value='true'> + <block atomic='true'> + <block atomic='true'> + <execute plugin="org.onap.ccsdk.sli.plugins.template.TemplateNode" method="evaluateTemplate" > + <parameter name='templatePath' value='a1-policy-type-create-schema-property-payload-template.vtl' /> + <parameter name='output' value='restapi-payload' /> + <parameter name='prefix' value='a1-mediator' /> + <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 A1 Mediator RestAPI payload template as a string"/> + <parameter name='field3' value='`$a1-mediator.restapi-payload`' /> + </record> + </block> + </outcome> + <outcome value='failure'> + <block> + <set> + <parameter name='response-code' value='500'/> + <parameter name='response-message' value='Error creating A1 Mediator Rest API payload string. Aborting A1 Policy Type creation'/> + </set> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="response-code" value="500" /> + <parameter name='response-message' value='Error creating A1 Mediator Rest API payload string. Aborting A1 Policy Type creation'/> + </return> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='createPolicyType'/> + <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="None" /> + </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 Not Required" /> + <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> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replaceAll' > + <parameter name="source" value="`$a1-mediator.restapi-payload`"/> + <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> + <set> + <parameter name='response-code' value='500'/> + <parameter name="response-message" value="Error removing lines from A1 Mediator Rest API payload string. Aborting A1 Policy creation" /> + </set> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="response-code" value="500" /> + <parameter name="response-message" value="Error removing lines from A1 Mediator Rest API payload string. Aborting A1 Policy creation" /> + </return> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='createPolicyType'/> + <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="None" /> + </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 Not Required" /> + <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> + <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=""/> + <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 tabs removed \r"/> + <parameter name='field3' value='`$tmp.a1-mediator-restapi.payload`' /> + </record> + </block> + </outcome> + <outcome value='failure'> + <block> + <set> + <parameter name='response-code' value='500'/> + <parameter name="response-message" value="Error removing tabs from A1 Mediator Rest API payload string. Aborting A1 Policy creation" /> + </set> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="response-code" value="500" /> + <parameter name="response-message" value="Error removing tabs from A1 Mediator Rest API payload string. Aborting A1 Policy creation" /> + </return> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='createPolicyType'/> + <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="None" /> + </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 Not Required" /> + <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 atomic='true'> + <set> + <parameter name="tmp.near-rt-ric-id" value="`$create-policy-type-input.near-rt-ric-id`"/> + <parameter name="tmp.policy-type-id" value="`$create-policy-type-input.policy-type-id`"/> + <parameter name="tmp.name" value="`$create-policy-type-input.name`"/> + <parameter name="tmp.description" value="`$create-policy-type-input.description`"/> + </set> + <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 Create Policy Type."/> + <parameter name="field2" value="`$tmp.near-rt-ric-id`"/> + <parameter name="field3" value="`$tmp.policy-type-id`"/> + <parameter name="field4" value="`$tmp.name`"/> + <parameter name="field5" value="`$tmp.restapi.policytype-url`"/> + <parameter name="field6" value="`$a1-mediator.restapi-payload`"/> + <parameter name="field7" value="Temporary A1 Mediatory Payload"/> + <parameter name="field8" value="`$tmp.a1-mediator-restapi.payload`"/> + </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="PUT"/> + <parameter name="responsePrefix" value="a1MediatorRsp"/> + <parameter name='contentType' value='application/json' /> + <parameter name='accept' value='application/json' /> + <parameter name="requestBody" value="`$tmp.a1-mediator-restapi.payload`"/> + <parameter name="convertResponse" value="false"/> + <outcome value='failure'> + <block> + <set> + <parameter name='response-code' value='500'/> + <parameter name="response-message" value="Error creating A1 Policy Policy. Aborting A1 Policy Type creation" /> + </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 Policy. Aborting A1 Policy Type creation" /> + </return> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='createPolicyType'/> + <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="None" /> + </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 Not Required" /> + <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> + <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 Accepted."/> + </record> + </block> + </outcome> + </execute> + </block> + </block> + </outcome> + <outcome value='false'> + <block> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='createPolicyType'/> + <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="None" /> + </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 Not Required" /> + <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> + <set> + <parameter name='response-code' value='500'/> + <parameter name='response-message' value='A1 Mediator Not Deployed'/> + </set> + <return status='failure'> + <parameter name='ack-final' value='Y'/> + <parameter name="response-code" value="500" /> + <parameter name="response-message" value="A1 Mediator Not Deployed. Aborting A1 Policy creation" /> + </return> + </block> + </outcome> + </switch> + <block> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='createPolicyType'/> + <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="None" /> + </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 Not Required" /> + <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 diff --git a/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_deletePolicyInstance.xml b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_deletePolicyInstance.xml new file mode 100644 index 00000000..6cc39b94 --- /dev/null +++ b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_deletePolicyInstance.xml @@ -0,0 +1,268 @@ +<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='deletePolicyInstance' 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 Policy Instance associated with Near RT RIC ID and Policy Type ID"/> + <parameter name="field2" value="`$delete-policy-instance-input.near-rt-ric-id`"/> + <parameter name="field3" value="`$delete-policy-instance-input.policy-type-id`"/> + <parameter name="field4" value="`$delete-policy-instance-input.policy-instance-id`"/> + </record> + <set> + <parameter name='response-code' value='200' /> + <parameter name='response-message' value='deletePolicyInstance 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="`$delete-policy-instance-input.near-rt-ric-id`"/> + <parameter name="tmp.policy-type-id" value="`$delete-policy-instance-input.policy-type-id`"/> + <parameter name="tmp.policy-instance-id" value="`$delete-policy-instance-input.policy-instance-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 Delete Policy Instance."/> + <parameter name="field2" value="`$tmp.near-rt-ric-id`"/> + <parameter name="field3" value="`$tmp.policy-type-id`"/> + <parameter name="field4" value="`$tmp.policy-instance-id`"/> + </record> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.policy`"/> + <parameter name="outputPath" value="tmp.restapi.policyinstance-url"/> + <parameter name="target" value="{policy_type_id}"/> + <parameter name="replacement" value="`$tmp.policy-type-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.restapi.policyinstance-url`"/> + <parameter name="outputPath" value="tmp.restapi.policyinstance-url"/> + <parameter name="target" value="{policy_instance_id}"/> + <parameter name="replacement" value="`$tmp.policy-instance-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 Delete Policy Instance."/> + <parameter name="field2" value="`$tmp.near-rt-ric-id`"/> + <parameter name="field3" value="`$tmp.policy-type-id`"/> + <parameter name="field4" value="`$tmp.policy-instance-id`"/> + <parameter name="field5" value="`$tmp.restapi.policyinstance-url`"/> + </record> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name="restapiUrl" value="`$prop.a1Mediator.url + '/' + $tmp.restapi.policyinstance-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="Details of A1 Policy Instance "/> + <parameter name="field2" value="`$a1MediatorRsp`"/> + </record> + </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 Deleting A1 Policy Instance. Aborting" /> + </return> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='deletePolicyInstance'/> + <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="Working On it" /> + </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='deletePolicyInstance'/> + <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="Working On it" /> + </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 Deleting A1 Policy Instance. Aborting" /> + </return> + </block> + </outcome> + </switch> + <block> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='deletePolicyInstance'/> + <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="Working On it" /> + </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='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_deletePolicyType.xml b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_deletePolicyType.xml new file mode 100644 index 00000000..7711962b --- /dev/null +++ b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_deletePolicyType.xml @@ -0,0 +1,257 @@ +<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='deletePolicyType' 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 Policy Type from Near RT RIC ID"/> + <parameter name="field2" value="`$delete-policy-type-input.near-rt-ric-id`"/> + <parameter name="field3" value="`$delete-policy-type-input.policy-type-id`"/> + </record> + <set> + <parameter name='response-code' value='200' /> + <parameter name='response-message' value='deletePolicyType 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="`$delete-policy-type-input.near-rt-ric-id`"/> + <parameter name="tmp.policy-type-id" value="`$delete-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 Delete 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 Delete 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="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="Delete policy type operation executed against A1 Mediator "/> + </record> + </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 Delete Policy. Aborting" /> + </return> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='deletePolicyType'/> + <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="Working On it" /> + </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='deletePolicyType'/> + <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="Working On it" /> + </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="A1 Mediator Not Deployed. Aborting Policy Delete" /> + </return> + </block> + </outcome> + </switch> + <block> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='deletePolicyType'/> + <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="Working On it" /> + </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 diff --git a/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getHealthCheck.xml b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getHealthCheck.xml index 6a9395a5..6ba77520 100644 --- a/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getHealthCheck.xml +++ b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getHealthCheck.xml @@ -2,11 +2,244 @@ 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='getHealthCheck' mode='sync'> - <set> - <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'/> - </set> + <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="A1 Adapter Health Check. Near RT RIC ID"/> + <parameter name="field2" value="`$get-health-check-input.near-rt-ric-id`"/> + </record> + <set> + <parameter name='response-code' value='200' /> + <parameter name='response-message' value='A1 is Healthy' /> + </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'> + <block atomic='true'> + <set> + <parameter name="tmp.near-rt-ric-id" value="`$get-health-check-input.near-rt-ric-id`"/> + <parameter name="tmp.restapi.healthcheck-url" value="`$prop.restapi.healthcheck`"/> + </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 Health Check."/> + <parameter name="field2" value="`$tmp.near-rt-ric-id`"/> + <parameter name="field3" value="`$tmp.restapi.healthcheck-url`"/> + </record> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name="restapiUrl" value="`$prop.a1Mediator.url + '/' + $tmp.restapi.healthcheck-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> + <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 Mediator is Healthy."/> + </record> + </block> + </outcome> + <outcome value='failure'> + <block> + <set> + <parameter name='response-code' value='500'/> + <parameter name='response-message' value='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 A1 Mediator Health Check. Aborting A1 Health Check" /> + </return> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='getHealthCheck'/> + <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="None" /> + </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 Not Required" /> + <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> + </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='getHealthCheck'/> + <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="None" /> + </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 Not Required" /> + <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="A1 Mediator Not Deployed. Aborting Health Check" /> + </return> + </block> + </outcome> + </switch> + <block> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='getHealthCheck'/> + <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="None" /> + </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 Not Required" /> + <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 diff --git a/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getPolicyInstance.xml b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getPolicyInstance.xml new file mode 100644 index 00000000..e20c3cd4 --- /dev/null +++ b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getPolicyInstance.xml @@ -0,0 +1,268 @@ +<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='getPolicyInstance' 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 Instance details associated with Near RT RIC ID and Policy Type ID"/> + <parameter name="field2" value="`$get-policy-instance-input.near-rt-ric-id`"/> + <parameter name="field3" value="`$get-policy-instance-input.policy-type-id`"/> + <parameter name="field4" value="`$get-policy-instance-input.policy-instance-id`"/> + </record> + <set> + <parameter name='response-code' value='200' /> + <parameter name='response-message' value='getPolicyInstance 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-instance-input.near-rt-ric-id`"/> + <parameter name="tmp.policy-type-id" value="`$get-policy-instance-input.policy-type-id`"/> + <parameter name="tmp.policy-instance-id" value="`$get-policy-instance-input.policy-instance-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 Instance."/> + <parameter name="field2" value="`$tmp.near-rt-ric-id`"/> + <parameter name="field3" value="`$tmp.policy-type-id`"/> + <parameter name="field4" value="`$tmp.policy-instance-id`"/> + </record> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.policy`"/> + <parameter name="outputPath" value="tmp.restapi.policyinstance-url"/> + <parameter name="target" value="{policy_type_id}"/> + <parameter name="replacement" value="`$tmp.policy-type-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.restapi.policyinstance-url`"/> + <parameter name="outputPath" value="tmp.restapi.policyinstance-url"/> + <parameter name="target" value="{policy_instance_id}"/> + <parameter name="replacement" value="`$tmp.policy-instance-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 Instance."/> + <parameter name="field2" value="`$tmp.near-rt-ric-id`"/> + <parameter name="field3" value="`$tmp.policy-type-id`"/> + <parameter name="field4" value="`$tmp.policy-instance-id`"/> + <parameter name="field5" value="`$tmp.restapi.policyinstance-url`"/> + </record> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name="restapiUrl" value="`$prop.a1Mediator.url + '/' + $tmp.restapi.policyinstance-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="Details of A1 Policy Instance "/> + <parameter name="field2" value="`$a1MediatorRsp`"/> + </record> + </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 Instances. Aborting" /> + </return> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='getPolicyInstance'/> + <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="Working On it" /> + </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='getPolicyInstance'/> + <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="Working On it" /> + </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 Instance. Aborting" /> + </return> + </block> + </outcome> + </switch> + <block> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='getPolicyInstance'/> + <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="Working On it" /> + </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='getPolicyInstance 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_getPolicyInstances.xml b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getPolicyInstances.xml new file mode 100644 index 00000000..5d272a78 --- /dev/null +++ b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getPolicyInstances.xml @@ -0,0 +1,258 @@ +<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='getPolicyInstances' 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 All Policy Instance from Near RT RIC ID and Policy Type ID"/> + <parameter name="field2" value="`$get-policy-instances-input.near-rt-ric-id`"/> + <parameter name="field3" value="`$get-policy-instances-input.policy-type-id`"/> + </record> + <set> + <parameter name='response-code' value='200' /> + <parameter name='response-message' value='getPolicyInstances 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-instances-input.near-rt-ric-id`"/> + <parameter name="tmp.policy-type-id" value="`$get-policy-instances-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 Instances."/> + <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.policies`"/> + <parameter name="outputPath" value="tmp.restapi.policyinstances-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 Instances."/> + <parameter name="field2" value="`$tmp.near-rt-ric-id`"/> + <parameter name="field3" value="`$tmp.policy-type-id`"/> + <parameter name="field4" value="`$tmp.restapi.policyinstances-url`"/> + </record> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name="restapiUrl" value="`$prop.a1Mediator.url + '/' + $tmp.restapi.policyinstances-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="List of A1 Policy Instances: "/> + <parameter name="field2" value="`$a1MediatorRsp`"/> + </record> + </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 Instances. Aborting" /> + </return> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='getPolicyInstances'/> + <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="Working On it" /> + </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='getPolicyInstances'/> + <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="Working On it" /> + </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 Instances. Aborting" /> + </return> + </block> + </outcome> + </switch> + <block> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='getPolicyInstances'/> + <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="Working On it" /> + </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='getPolicyInstances 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_getPolicyType.xml b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getPolicyType.xml new file mode 100644 index 00000000..b598ef30 --- /dev/null +++ b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getPolicyType.xml @@ -0,0 +1,258 @@ +<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.*`"/> + </record> + </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="Working On it" /> + </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="Working On it" /> + </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="Working On it" /> + </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 diff --git a/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getPolicyTypes.xml b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getPolicyTypes.xml new file mode 100644 index 00000000..97ff3138 --- /dev/null +++ b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getPolicyTypes.xml @@ -0,0 +1,244 @@ +<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='getPolicyTypes' 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 All Policy Types from Near RT RIC ID"/> + <parameter name="field2" value="`$get-policy-types-input.near-rt-ric-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-types-input.near-rt-ric-id`"/> + <parameter name="tmp.restapi.getPolicyTypes-url" value="`$prop.restapi.policytypes`"/> + </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 Types."/> + <parameter name="field2" value="`$tmp.near-rt-ric-id`"/> + <parameter name="field3" value="`$tmp.restapi.getPolicyTypes-url`"/> + </record> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name="restapiUrl" value="`$prop.a1Mediator.url + '/' + $tmp.restapi.getPolicyTypes-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="List of A1 Policy Types: "/> + <parameter name="field2" value="`$a1MediatorRsp`"/> + </record> + </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 Types. Aborting" /> + </return> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='getPolicyTypes'/> + <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="`$a1MediatorRsp`" /> + </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='getPolicyTypes'/> + <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="`$a1MediatorRsp`" /> + </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 Types. Aborting" /> + </return> + </block> + </outcome> + </switch> + <block> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='getPolicyTypes'/> + <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="`$a1MediatorRsp`" /> + </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 diff --git a/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getStatus.xml b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getStatus.xml new file mode 100644 index 00000000..fcc6da46 --- /dev/null +++ b/platform-logic/a1Adapter-api/src/main/xml/A1-ADAPTER-API_getStatus.xml @@ -0,0 +1,268 @@ +<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='getStatus' 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 status of Policy Instance associated with Near RT RIC ID and Policy Type ID"/> + <parameter name="field2" value="`$get-status-input.near-rt-ric-id`"/> + <parameter name="field3" value="`$get-status-input.policy-type-id`"/> + <parameter name="field4" value="`$get-status-input.policy-instance-id`"/> + </record> + <set> + <parameter name='response-code' value='200' /> + <parameter name='response-message' value='getStatus 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-status-input.near-rt-ric-id`"/> + <parameter name="tmp.policy-type-id" value="`$get-status-input.policy-type-id`"/> + <parameter name="tmp.policy-instance-id" value="`$get-status-input.policy-instance-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 Getting status for Policy Instance."/> + <parameter name="field2" value="`$tmp.near-rt-ric-id`"/> + <parameter name="field3" value="`$tmp.policy-type-id`"/> + <parameter name="field4" value="`$tmp.policy-instance-id`"/> + </record> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$prop.restapi.policystatus`"/> + <parameter name="outputPath" value="tmp.restapi.policyinstance-url"/> + <parameter name="target" value="{policy_type_id}"/> + <parameter name="replacement" value="`$tmp.policy-type-id`"/> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' > + <parameter name="source" value="`$tmp.restapi.policyinstance-url`"/> + <parameter name="outputPath" value="tmp.restapi.policyinstance-url"/> + <parameter name="target" value="{policy_instance_id}"/> + <parameter name="replacement" value="`$tmp.policy-instance-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 getting status for Policy Instance."/> + <parameter name="field2" value="`$tmp.near-rt-ric-id`"/> + <parameter name="field3" value="`$tmp.policy-type-id`"/> + <parameter name="field4" value="`$tmp.policy-instance-id`"/> + <parameter name="field5" value="`$tmp.restapi.policyinstance-url`"/> + </record> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name="restapiUrl" value="`$prop.a1Mediator.url + '/' + $tmp.restapi.policyinstance-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> + <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="Status of A1 Policy Instance "/> + <parameter name="field2" value="`$a1MediatorRsp`"/> + </record> + </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 status for A1 Policy Instance. Aborting" /> + </return> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='getStatus'/> + <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="Working On it" /> + </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='getStatus'/> + <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="Working On it" /> + </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 status for A1 Policy Instance. Aborting" /> + </return> + </block> + </outcome> + </switch> + <block> + <block atomic='true'> + <set> + <parameter name='tmp.a1-adapter-api.rpc-name' value='getStatus'/> + <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="Working On it" /> + </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='getStatus executed successfully'/> + <parameter name='ack-final' value='Y'/> + </return> + </block> + </block> + </method> +</service-logic>
\ No newline at end of file |