aboutsummaryrefslogtreecommitdiffstats
path: root/platform-logic/optical-service/src/main/xml/optical-service_service-delete-msa.xml
blob: 2eb381644da181f14e664b38626b51117ab1f10d (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<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='optical-service' version='${project.version}'>
    <method rpc='service-delete-msa' mode='sync'>
        <block atomic="true">
            <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL'
key='SELECT controller_id
from REQUEST_DETAILS
WHERE request_id = $domain-service1'
pfx='detail-db1'>
                <outcome value='success'>
                    <set>
                        <parameter name='controller-id1' value='`$detail-db1.controller-id`' />
                    </set>
                </outcome>
            </get-resource>
            <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliStringUtils' method='split' >
                <parameter name="original_string" value='`$controller-id1`'/>
                <parameter name="regex" value="_"/>
                <parameter name="ctx_memory_result_key" value="param-prefix"/>
            </execute>
            <set>
                <parameter name='domain-type' value='`$param-prefix[0]`' />
                <parameter name='controller-ip' value='`$param-prefix[1]`' />
                <parameter name='optical-service-delete-input.request-id' value="`$domain-service1`" />
                <parameter name='optical-service-delete-input.payload.service-name' value="`$service-name + $param-prefix[2]`"/>
            </set>
            <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
                <parameter name="templateFileName" value="`$prop.restapi.templateDir + '/optical-service-delete-msa.json'`" />
                <parameter name="restapiUrl" value="`$controller-ip + '/cxf/openroadm/openroadm-services/' + $optical-service-delete-input.payload.service-name`"/>
                <parameter name='restapiUser' value='admin' />
                <parameter name='restapiPassword' value='admin' />
                <parameter name="httpMethod" value="DELETE"/>
                <parameter name="responsePrefix" value="service-delete-response"/>
                <parameter name='contentType' value='application/json' />
                <parameter name='format' value='json' />
                <parameter name="trustStoreFileName" value="/opt/onap/sdnc/data/stores/truststore.onap.client.msa.jks"/>
                <parameter name="trustStorePassword" value="adminadmin"/>
                <parameter name="keyStoreFileName" value="/opt/onap/sdnc/data/stores/sdnc.p12"/>
                <parameter name="keyStorePassword" value="adminadmin"/>
                <outcome value='failure'>
                    <block atomic='true'>
                        <return status='failure'>
                            <parameter name='error-code' value='500' />
                            <parameter name='error-message' value='Error deleting the Service' />
                        </return>
                    </block>
                </outcome>
                <outcome value='success'>
                    <block atomic='true'>
                        <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
                            <parameter name="file" value="/opt/opendaylight/current/data/log/optical-service-create.log" />
                            <parameter name="level" value="info" />
                            <parameter name="field1" value="Successfully sent the request"/>
                        </record>
                        <switch test='`$service-delete-response.configuration-response-common.response-code`'>
                            <outcome value='Other'>
                                <return status='failure'>
                                    <parameter name='error-code' value='`$service-delete-response.configuration-response-common.response-code`' />
                                    <parameter name='error-message' value='`$service-delete-response.configuration-response-common.response-message`' />
                                </return>
                            </outcome>
                            <outcome value='200'>
                                <block atomic='true'>
                                    <record plugin="org.onap.ccsdk.sli.core.sli.recording.FileRecorder">
                                        <parameter name="file" value="/opt/opendaylight/current/data/log/optical-service-create.log" />
                                        <parameter name="level" value="info" />
                                        <parameter name="field1" value="Inside controller"/>
                                    </record>
                                    <get-resource plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' resource='SQL' 
key='SELECT *
from REQUEST_DETAILS 
WHERE request_id = $optical-service-delete-input.request-id'
pfx='output'></get-resource>
                                    <set>
                                        <parameter name='request-id' value='`$optical-service-create-input.request-id`' />
                                    </set>
                                    <call module='optical-service' rpc='aai-delete-service-handling' mode='sync' ></call>
                                    <set>
                                        <parameter name='final-response-code' value="200" />
                                    </set>
                                </block>
                            </outcome>
                        </switch>
                    </block>
                </outcome>
            </execute>
        </block>
    </method>
</service-logic>