aboutsummaryrefslogtreecommitdiffstats
path: root/platform-logic/generic-resource-api/src/main/xml/sdwan/GENERIC-RESOURCE-API_sdwan-get-tenant-auth.xml
blob: 7fffebd56fb1b2d054fdfa5ac383c058f06a28af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<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="templateFileName" value="`$prop.restapi.templateDir + '/actokentemplate.json'`" />
                <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>