aboutsummaryrefslogtreecommitdiffstats
path: root/platform-logic/lcm/src/main/xml/LCM_config-scale-out.xml
blob: ce836e21a03485446c3bb20c6966782807d4bd5a (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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<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='LCM' version='${project.version}'>
    <method rpc='config-scale-out' mode='sync'>
        <block>
            <execute plugin='org.onap.ccsdk.sli.plugins.prop.PropertiesNode' method='readProperties' >
                <parameter name='fileName' value='%SDNC_CONFIG_DIR%/lcm-dg.properties' />
                <parameter name='contextPrefix' value='prop' />
            </execute>
            <set>
                <parameter name='status.code' value='200' />
                <parameter name='status.message' value='unexpected return from LCM DG' />
            </set>
            <execute plugin='org.onap.ccsdk.sli.core.slipluginutils.SliPluginUtils' method='jsonStringToCtx'>
                <parameter name='source' value='config-scale-out-input.payload' />
                <parameter name='outputPath' value='payloadJson' />
                <parameter name='isEscaped' value='true' />
                <outcome value='success'>
                    <record plugin='org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder'>
                        <parameter name='logger' value='message-log'/>
                        <parameter name='field1' value='`$payloadJson.request-parameters.host-ip-address`'/>
                        <parameter name='field2' value='`$payloadJson.configuration-parameters.ip-addr`'/>
                    </record>
                </outcome>
            </execute>
            <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
                <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.lcm.restconf.configscaleout.templatefile`" />
                <parameter name='restapiUrl' value="`'http://' + $payloadJson.request-parameters.host-ip-address + ':' + $prop.lcm.restconf.port + $prop.lcm.restconf.configscaleout.urlpath  + $payloadJson.configuration-parameters.ip-addr`" />
                <parameter name='restapiUser' value='`$prop.lcm.restconf.configscaleout.user`' />
                <parameter name='restapiPassword' value='`$prop.lcm.restconf.configscaleout.password`' />
                <parameter name='format' value='json' />
                <parameter name='httpMethod' value='PUT' />
                <parameter name='contentType' value='application/json' />
                <parameter name="responsePrefix" value="restconf" />
                <outcome value='failure'>
                    <block>
                        <set>
                            <parameter name='lcm-dmaap.version' value='`$prop.lcm.dmaap.version`'/>
                            <parameter name='lcm-dmaap.correlation-id' value="`$config-scale-out-input.common-header.request-id + '-' + $config-scale-out-input.common-header.sub-request-id`"/>
                            <parameter name='lcm-dmaap.partition' value='`$prop.lcm.dmaap.partition`'/>
                            <parameter name='lcm-dmaap.rpc-name' value='config-scale-out'/>
                            <parameter name='lcm-dmaap.type' value='`$prop.lcm.dmaap.type`'/>
                            <parameter name='lcm-dmaap.timestamp' value='`$config-scale-out-input.common-header.timestamp`'/>
                            <parameter name='lcm-dmaap.api-ver' value='`$config-scale-out-input.common-header.api-ver`'/>
                            <parameter name='lcm-dmaap.originator-id' value='`$config-scale-out-input.common-header.originator-id`'/>
                            <parameter name='lcm-dmaap.request-id' value='`$config-scale-out-input.common-header.request-id`'/>
                            <parameter name='lcm-dmaap.sub-request-id' value='`$config-scaleout-input.common-header.sub-request-id`'/>
                            <parameter name='lcm-dmaap.flags.mode' value='`$config-scale-out-input.common-header.flags.mode`'/>
                            <parameter name='lcm-dmaap.flags.force' value='`$config-scale-out-input.common-header.flags.force`'/>
                            <parameter name='lcm-dmaap.flags.ttl' value='`$config-scale-out-input.common-header.flags.ttl`'/>
                            <parameter name='lcm-dmaap.status.code' value='401' />
                            <parameter name='lcm-dmaap.status.message' value="`'DG-Failure '  + $restconf.response-message + ' RestConf ResponseCode=' + $restconf.response-code`"/>
                        </set>
                        <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
                            <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.lcm.dmaap.publish.templatefile`" />
                            <parameter name='restapiUrl' value='`$prop.lcm.dmaap.url`' />
                            <parameter name='restapiUser' value='`$prop.lcm.dmaap.user`' />
                            <parameter name='restapiPassword' value='`$prop.lcm.dmaap.password`' />
                            <parameter name='format' value='json' />
                            <parameter name='httpMethod' value='POST' />
                            <parameter name='contentType' value='application/json' />
                            <parameter name='responsePrefix' value='dmaap' />
                            <outcome value='failure'>
                                <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
                                    <parameter name="logger" value="message-log"/>
                                    <parameter name="field1" value='Failed to Publish to DMaap'/>
                                </record>
                            </outcome>
                        </execute>
                        <return status='failure'>
                            <parameter name='status.code' value= '`$lcm-dmaap.status.code`'/>
                            <parameter name='status.message' value='`$lcm-dmaap.status.message`' />
                        </return>
                    </block>
                </outcome>
                <outcome value='success'>
                    <block>
                        <set>
                            <parameter name='lcm-dmaap.version' value='`$prop.lcm.dmaap.version`'/>
                            <parameter name='lcm-dmaap.correlation-id' value="`$config-scale-out-input.common-header.request-id + '-' + $upgrade-software-input.common-header.sub-request-id`"/>
                            <parameter name='lcm-dmaap.partition' value='`$prop.lcm.dmaap.partition`'/>
                            <parameter name='lcm-dmaap.rpc-name' value='config-scale-out'/>
                            <parameter name='lcm-dmaap.type' value='`$prop.lcm.dmaap.type`'/>
                            <parameter name='lcm-dmaap.timestamp' value='`$config-scale-out-input.common-header.timestamp`'/>
                            <parameter name='lcm-dmaap.api-ver' value='`$config-scaleout-input.common-header.api-ver`'/>
                            <parameter name='lcm-dmaap.originator-id' value='`$config-scale-out-input.common-header.originator-id`'/>
                            <parameter name='lcm-dmaap.request-id' value='`$config-scale-out-input.common-header.request-id`'/>
                            <parameter name='lcm-dmaap.sub-request-id' value='`$config-scale-out-input.common-header.sub-request-id`'/>
                            <parameter name='lcm-dmaap.flags.mode' value='`$config-scale-out-input.common-header.flags.mode`'/>
                            <parameter name='lcm-dmaap.flags.force' value='`$config-scale-out-input.common-header.flags.force`'/>
                            <parameter name='lcm-dmaap.flags.ttl' value='`$config-scale-out-input.common-header.flags.ttl`'/>
                            <parameter name='lcm-dmaap.status.code' value='`$restconf.response-code`' />
                            <parameter name='lcm-dmaap.status.message' value='`$restconf.response-message`'/>
                        </set>
                        <execute plugin='org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode' method='sendRequest' >
                            <parameter name='templateFileName' value="`$prop.restapi.templateDir + '/' + $prop.restapi.lcm.dmaap.publish.templatefile`" />
                            <parameter name='restapiUrl' value='`$prop.lcm.dmaap.url`' />
                            <parameter name='restapiUser' value='`$prop.lcm.dmaap.user`' />
                            <parameter name='restapiPassword' value='`$prop.lcm.dmaap.password`' />
                            <parameter name='format' value='json' />
                            <parameter name='httpMethod' value='POST' />
                            <parameter name='contentType' value='application/json' />
                            <parameter name='responsePrefix' value='dmaap' />
                            <outcome value='failure'>
                                <record plugin="org.onap.ccsdk.sli.core.sli.recording.Slf4jRecorder">
                                    <parameter name="logger" value="message-log"/>
                                    <parameter name="field1" value='Failed to Publish to DMaap'/>
                                </record>
                            </outcome>
                        </execute>
                        <return status='success'>
                            <parameter name='status.code' value='`$restconf.response-code`' />
                            <parameter name='status.message' value='`$restconf.response-message`' />
                        </return>
                    </block>
                </outcome>
            </execute>
        </block>
    </method>
</service-logic>