summaryrefslogtreecommitdiffstats
path: root/platform-logic/generic-resource-api/src/main/xml/GENERIC-RESOURCE-API_policy-manager-create-policy.xml
blob: c6d45de28ab14912be436e82d1aacc9516076ea3 (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
<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='policy-manager-create-policy' mode='sync'>
        <block atomic="true">
            <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
                <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.createpolicy.templatefile`" />
                <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/createPolicy'`" />
                <parameter name='format' value='json' />
                <parameter name='httpMethod' value='PUT' />
                <parameter name='convertResponse' value="false" />
                <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">
                        <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
                            <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.pm.pushpolicy.templatefile`" />
                            <parameter name='restapiUrl' value="`$prop.policy-manager.url + '/pdp/api/pushPolicy'`" />
                            <parameter name='format' value='json' />
                            <parameter name='httpMethod' value='PUT' />
                            <parameter name='convertResponse' value="false" />
                            <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 push policy in Policy Manager' />
                                </return>
                            </outcome>
                        </execute>
                    </block>
                </outcome>
                <outcome value='Other'>
                    <return status='failure'>
                        <parameter name='error-code' value='500' />
                        <parameter name='error-message' value='Failed to create policy in Policy Manager' />
                    </return>
                </outcome>
            </execute>
            <return status='success'></return>
        </block>
    </method>
</service-logic>