diff options
author | 2018-07-26 18:10:42 +0000 | |
---|---|---|
committer | 2018-07-26 18:10:42 +0000 | |
commit | 5a41e5c15bdbfba0e84e89e13bb06d9930988e77 (patch) | |
tree | 72fa804d3fc3f1e286e3c8e1209309e97a3ff528 /platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-get-policy.xml | |
parent | 3b79de733187d2c1c9bccf626958a43bb06dbf2e (diff) |
Generic resource API DG catch up
Generic resource API DG catch up with several new capabilities
Change-Id: I6ba4a1716693a2fb0ba5314f60038277a50249a3
Issue-ID: SDNC-403
Signed-off-by: Brandon, Bruce (bb2697) <bb2697@att.com>
Former-commit-id: dd97cf829ce1c0b3bbb0e98e93a2e6619d945beb
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-get-policy.xml')
-rw-r--r-- | platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-get-policy.xml | 113 |
1 files changed, 113 insertions, 0 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-get-policy.xml b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-get-policy.xml new file mode 100644 index 00000000..a5e7438d --- /dev/null +++ b/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_port-mirror-get-policy.xml @@ -0,0 +1,113 @@ +<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='GENERIC-RESOURCE-API' version='${project.version}'> + <method rpc='port-mirror-get-policy' mode='sync'> + <block atomic="true"> + <set> + <parameter name='tmp.policy-name' value='`$db.cap[0].policy-name`' /> + </set> + <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' > + <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.getpolicy.templatefile`" /> + <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/getConfig'`" /> + <parameter name='format' value='json' /> + <parameter name='httpMethod' value='POST' /> + <parameter name='responsePrefix' value="policy" /> + <parameter name='customHttpHeaders' + value="`'Authorization=Basic ' + $prop.policy-manager.authorization + ',ClientAuth=Basic ' + $prop.policy-manager.clientauth + ',Environment=' + $prop.policy-manager.environment `" /> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Failed to get policy from Policy Manager' /> + </return> + </outcome> + </execute> + <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='jsonStringToCtx' > + <parameter name='source' value="policy.config" /> + <parameter name='outputPath' value="tmp.config-ctx" /> + <parameter name='isEscaped' value='false' /> + <outcome value='success'> + <block atomic="true"></block> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value='Failed to convert config variable from PolicyManager' /> + </return> + </outcome> + </execute> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="toLower"> + <parameter name="source" value="`$tmp.tenant-context`" /> + <parameter name="outputPath" value="tmp.lc-tenant-context" /> + </execute> + <switch test='`$tmp.lc-tenant-context`'> + <outcome value=''> + <set> + <parameter name='tmp.dest-p-interface' value='`$tmp.config-ctx.content.defaultContext`' /> + </set> + </outcome> + <outcome value='Other'> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome='true'> + <parameter name="source" value="`$tmp.lc-tenant-context`" /> + <parameter name="target" value="prod" /> + <outcome value='true'> + <set> + <parameter name='tmp.dest-p-interface' value='`$tmp.config-ctx.content.productionContext`' /> + </set> + </outcome> + <outcome value='Other'> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome='true'> + <parameter name="source" value="`$tmp.lc-tenant-context`" /> + <parameter name="target" value="test" /> + <outcome value='true'> + <set> + <parameter name='tmp.dest-p-interface' value='`$tmp.config-ctx.content.testContext`' /> + </set> + </outcome> + <outcome value='Other'> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome='true'> + <parameter name="source" value="`$tmp.lc-tenant-context`" /> + <parameter name="target" value="dev" /> + <outcome value='true'> + <set> + <parameter name='tmp.dest-p-interface' value='`$tmp.config-ctx.content.developmentContext`' /> + </set> + </outcome> + <outcome value='Other'> + <execute plugin="org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils" method="contains" emitsOutcome='true'> + <parameter name="source" value="`$tmp.lc-tenant-context`" /> + <parameter name="target" value="default" /> + <outcome value='true'> + <set> + <parameter name='tmp.dest-p-interface' value='`$tmp.config-ctx.content.defaultContext`' /> + </set> + </outcome> + <outcome value='Other'> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Unexpected tenant-context value of ' + $tmp.tenant-context`" /> + </return> + </outcome> + </execute> + </outcome> + </execute> + </outcome> + </execute> + </outcome> + </execute> + </outcome> + </switch> + <switch test='`$tmp.dest-p-interface`'> + <outcome value=''> + <return status='failure'> + <parameter name='error-code' value='500' /> + <parameter name='error-message' value="`'Unable to find p-interface in policy ' + tmp.policy-name`" /> + </return> + </outcome> + </switch> + <return status='success'></return> + </block> + </method> +</service-logic>
\ No newline at end of file |