aboutsummaryrefslogtreecommitdiffstats
path: root/runtime/src/main/resources/clds/camel/routes/controlloop-flows.xml
blob: d2bf39b1691c56352d347a2433cc225de6151b62 (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
<routes xmlns="http://camel.apache.org/schema/spring">
    <route id="get-service-template">
        <from uri="direct:get-service-template"/>
        <doTry>
            <log loggingLevel="INFO"
                 message="Getting the tosca service template"/>
            <to
                    uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('Controlloop', 'Getting the tosca service template')"/>
            <setHeader name="CamelHttpMethod">
                <constant>GET</constant>
            </setHeader>
            <setHeader name="Content-Type">
                <constant>application/json</constant>
            </setHeader>
            <setProperty name="name">
                <simple>${header.name}</simple>
            </setProperty>
            <setProperty name="version">
                <simple>${header.version}</simple>
            </setProperty>
            <log loggingLevel="INFO"
                 message="Endpoint to get Tosca Service Template: {{clamp.config.controlloop.runtime.url}}/onap/controlloop/v2/commission/toscaservicetemplate"></log>
            <toD uri="{{clamp.config.controlloop.runtime.url}}/onap/controlloop/v2/commission/toscaservicetemplate?name=${exchangeProperty[name]}&amp;version=${exchangeProperty[version]}&amp;bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authMethod=Basic&amp;authUsername={{clamp.config.controlloop.runtime.userName}}&amp;authPassword={{clamp.config.controlloop.runtime.password}}&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
            <convertBodyTo type="java.lang.String"/>
            <doFinally>
                <to uri="direct:reset-raise-http-exception-flag"/>
                <to
                        uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
            </doFinally>
        </doTry>
    </route>
    <route id="commission-service-template">
        <from uri="direct:commission-service-template"/>
        <doTry>
            <log loggingLevel="INFO"
                 message="Commissioning the tosca service template"/>
            <to
                    uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('Controlloop', 'Commissioning the tosca service template')"/>
            <setHeader name="CamelHttpMethod">
                <constant>POST</constant>
            </setHeader>
            <setHeader name="Content-Type">
                <constant>application/json</constant>
            </setHeader>
            <log loggingLevel="INFO"
                 message="Endpoint to send Tosca Service Template: {{clamp.config.controlloop.runtime.url}}/onap/controlloop/v2/commission"></log>
            <toD
                    uri="{{clamp.config.controlloop.runtime.url}}/onap/controlloop/v2/commission? bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authMethod=Basic&amp;authUsername={{clamp.config.controlloop.runtime.userName}}&amp;authPassword={{clamp.config.controlloop.runtime.password}}&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
            <convertBodyTo type="java.lang.String"/>
            <doFinally>
                <to uri="direct:reset-raise-http-exception-flag"/>
                <to
                        uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
            </doFinally>
        </doTry>
    </route>
    <route id="get-tosca-instantiation">
        <from uri="direct:get-tosca-instantiation"/>
        <doTry>
            <log loggingLevel="INFO"
                 message="Getting the Tosca instantiation"/>
            <to
                    uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeLog('ControlLoop', 'Getting the Tosca instantiation')"/>
            <setHeader name="CamelHttpMethod">
                <constant>GET</constant>
            </setHeader>
            <setHeader name="Content-Type">
                <constant>application/json</constant>
            </setHeader>
            <log loggingLevel="INFO"
                 message="Endpoint to get Tosca Instantiation: {{clamp.config.controlloop.runtime.url}}/onap/controlloop/v2/instantiation"></log>
            <toD
                    uri="{{clamp.config.controlloop.runtime.url}}/onap/controlloop/v2/instantiation?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authMethod=Basic&amp;authUsername={{clamp.config.controlloop.runtime.userName}}&amp;authPassword={{clamp.config.controlloop.runtime.password}}&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
            <convertBodyTo type="java.lang.String"/>
            <doFinally>
                <to uri="direct:reset-raise-http-exception-flag"/>
                <to
                        uri="bean:org.onap.policy.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
            </doFinally>
        </doTry>
    </route>
</routes>