Chore: Add gerrit maven verify GHA workflow
[sdnc/oam.git] / platform-logic / generic-resource-api / src / main / xml / GENERIC-RESOURCE-API_port-mirror-topology-operation-deactivate-sync.xml
1 <service-logic
2     xmlns='http://www.onap.org/sdnc/svclogic'
3     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}'>
4     <method rpc='port-mirror-topology-operation-deactivate-sync' mode='sync'>
5         <block atomic="true">
6             <set>
7                 <parameter name='tmp.pm.configuration-id' value='`$port-mirror-topology-operation-input.configuration-information.configuration-id`' />
8             </set>
9             <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
10                 <parameter name='fileName' value='%SDNC_CONFIG_DIR%/generic-resource-api-dg.properties' />
11                 <parameter name='contextPrefix' value='prop' />
12             </execute>
13             <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='replace' >
14                 <parameter name="source" value="`$prop.restapi.pm-configuration`"/>
15                 <parameter name="outputPath" value="tmp.pmc-url"/>
16                 <parameter name="target" value="{configuration-id}"/>
17                 <parameter name="replacement" value="`$tmp.pm.configuration-id`"/>
18             </execute>
19             <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
20                 <parameter name='restapiUrl' value='`$prop.controller.url + $tmp.pmc-url`' />
21                 <parameter name='restapiUser' value='`$prop.controller.user`' />
22                 <parameter name='restapiPassword' value='`$prop.controller.pwd`' />
23                 <parameter name='format' value='json' />
24                 <parameter name='httpMethod' value='GET' />
25                 <parameter name="responsePrefix" value="mdsal-pmc" />
26                 <outcome value='success'>
27                     <switch test='`$mdsal-pmc.port-mirror-configuration_length == 1`'>
28                         <outcome value='false'>
29                             <return status='failure'>
30                                 <parameter name='error-code' value='500' />
31                                 <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.pm.configuration-id`" />
32                             </return>
33                         </outcome>
34                     </switch>
35                 </outcome>
36                 <outcome value='Other'>
37                     <return status='failure'>
38                         <parameter name='error-code' value='500' />
39                         <parameter name='error-message' value="`'Cannot find port-mirror-configuration ' + $tmp.pm.configuration-id`" />
40                     </return>
41                 </outcome>
42             </execute>
43             <switch test="`$mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status == 'Active'`">
44                 <outcome value='false'>
45                     <return status='failure'>
46                         <parameter name='error-code' value='500' />
47                         <parameter name='error-message' value="`'Order status is ' + $mdsal-pmc.port-mirror-configuration[0].configuration-data.configuration-oper-status.order-status + ' but must be Active'`" />
48                     </return>
49                 </outcome>
50             </switch>
51             <return status='success'>
52                 <parameter name='error-code' value='200' />
53                 <parameter name='ack-final' value='N' />
54             </return>
55         </block>
56     </method>
57 </service-logic>