aboutsummaryrefslogtreecommitdiffstats
path: root/platform-logic/optical-service/src/main/xml/optical-service_service-delete-msa.xml
blob: 562195a0dfcd89f194b752c3c39f8c9e0b0a2980 (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
<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">
            <set>
                <parameter name='optical-service-create-input.request-id' value="`$domain-service1`" />
                <parameter name='optical-service-delete-input.payload.service-name' value="`$optical-service-delete-input.payload.param[0].value + '_MDONS-OTN-MSA'`"/>
            </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>
                                    <save plugin='org.onap.ccsdk.sli.adaptors.resource.sql.SqlResource' 
resource='SQL' 
key='UPDATE REQUEST_DETAILS SET status = "DELETING" WHERE request_id = $optical-service-delete-input.request-id' 
force='true' pfx='save-result'></save>
                                    <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='db.request-details'>
                                        <outcome value='success'>
                                            <set>
                                                <parameter name='instance-id' value='`$db.request-details.service-instance-id`' />
                                                <parameter name='customer-id' value='`$db.request-details.global-customer-id`' />
                                                <parameter name='service-id' value='`$db.request-details.service-type`' />
                                            </set>
                                        </outcome>
                                    </get-resource>
                                    <update plugin='org.onap.ccsdk.sli.adaptors.aai.AAIService' 
force='true' 
resource='service-instance' 
key = 'customer.global-customer-id = $customer-id AND
     service-subscription.service-type = $service-id AND
     service-instance.service-instance-id = $instance-id'
local-only='false'>
                                        <parameter name='orchestration-status' value='DELETING' />
                                    </update>
                                    <set>
                                        <parameter name='final-response-code' value="200" />
                                    </set>
                                </block>
                            </outcome>
                        </switch>
                    </block>
                </outcome>
            </execute>
        </block>
    </method>
</service-logic>