aboutsummaryrefslogtreecommitdiffstats
path: root/platform-logic/generic-resource-api/src/main/xml/sdwan/GENERIC-RESOURCE-API_sdwan-get-tenant-auth.xml
diff options
context:
space:
mode:
Diffstat (limited to 'platform-logic/generic-resource-api/src/main/xml/sdwan/GENERIC-RESOURCE-API_sdwan-get-tenant-auth.xml')
-rw-r--r--platform-logic/generic-resource-api/src/main/xml/sdwan/GENERIC-RESOURCE-API_sdwan-get-tenant-auth.xml50
1 files changed, 50 insertions, 0 deletions
diff --git a/platform-logic/generic-resource-api/src/main/xml/sdwan/GENERIC-RESOURCE-API_sdwan-get-tenant-auth.xml b/platform-logic/generic-resource-api/src/main/xml/sdwan/GENERIC-RESOURCE-API_sdwan-get-tenant-auth.xml
new file mode 100644
index 00000000..98d8bc9e
--- /dev/null
+++ b/platform-logic/generic-resource-api/src/main/xml/sdwan/GENERIC-RESOURCE-API_sdwan-get-tenant-auth.xml
@@ -0,0 +1,50 @@
+<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='sdwan-get-tenant-auth' mode='sync'>
+ <block atomic="true">
+ <get-resource plugin="org.onap.ccsdk.sli.adaptors.aai.AAIService"
+ resource="service-subscription"
+ key= 'service-subscription.service-type = $service-data.vnfs.vnf[$tmp.vidx].vnf-data.service-information.subscription-service-type
+ AND customer.global-customer-id = $service-data.vnfs.vnf[$tmp.vidx].vnf-data.service-information.global-customer-id'
+ force="true" pfx="tmp.AnAI-data-tenant">
+ <outcome value='success'>
+ <switch test='`$tmp.AnAI-data-tenant.temp-ub-sub-account-id`'>
+ <outcome value=''>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing get token rest api" />
+ </return>
+ </outcome>
+ <outcome value='Other'>
+ <set>
+ <parameter name='prop.tenant-id' value='`$tmp.AnAI-data-tenant.temp-ub-sub-account-id`' />
+ </set>
+ </outcome>
+ </switch>
+ </outcome>
+ <outcome value='failure'>
+ <return status='failure'>
+ <parameter name='ack-final' value='Y'/>
+ <parameter name="error-code" value="500" />
+ <parameter name="error-message" value="Error executing get token rest api" />
+ </return>
+ </outcome>
+ </get-resource>
+ <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
+ <parameter name="restapiUrl" value="`$prop.sdncRestApi.thirdpartySdnc.url + '/controller/campus/v1/baseservice/tenants/authorization/' + $prop.tenant-id`" />
+ <parameter name="restapiUser" value="`$prop.sdncRestApi.thirdpartySdnc.user`" />
+ <parameter name="restapiPassword" value="`$prop.sdncRestApi.thirdpartySdnc.password`" />
+ <parameter name="format" value="json"/>
+ <parameter name="httpMethod" value="put"/>
+ <parameter name="responsePrefix" value="tenant-result"/>
+ <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.jks"/>
+ <parameter name="trustStorePassword" value="adminadmin"/>
+ <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
+ <parameter name="keyStorePassword" value="adminadmin"/>
+ <parameter name='customHttpHeaders' value="`'X-ACCESS-TOKEN=' + $prop.sdncRestApi.token_id`" />
+ </execute>
+ </block>
+ </method>
+</service-logic>