9946c990bb1adef902896581e32e5a72da65e2da
[clamp.git] / src / main / resources / clds / camel / routes / cds-flows.xml
1 <routes xmlns="http://camel.apache.org/schema/spring">
2     <route id="get-blueprint-workflow-list">
3         <from uri="direct:get-blueprint-workflow-list"/>
4         <log loggingLevel="INFO"
5              message="Getting blueprint workflow list from CDS"/>
6         <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('CDS', 'Getting workflow list from CDS')"/>
7         <doTry>
8             <setHeader headerName="CamelHttpMethod">
9                 <constant>GET</constant>
10             </setHeader>
11             <setHeader headerName="Content-Type">
12                 <constant>application/json</constant>
13             </setHeader>
14             <log loggingLevel="INFO"
15                  message="Endpoint to query workflows from CDS : {{clamp.config.cds.url}}/api/v1/blueprint-model/workflows/blueprint-name/${exchangeProperty[blueprintName]}/version/${exchangeProperty[blueprintVersion]}"></log>
16             <toD uri="{{clamp.config.cds.url}}/api/v1/blueprint-model/workflows/blueprint-name/${exchangeProperty[blueprintName]}/version/${exchangeProperty[blueprintVersion]}?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authMethod=Basic&amp;authUsername={{clamp.config.cds.userName}}&amp;authPassword={{clamp.config.cds.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=30000&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
17             <convertBodyTo type="java.lang.String"/>
18             <doCatch>
19                 <exception>java.lang.Exception</exception>
20                 <handled>
21                     <constant>true</constant>
22                 </handled>
23
24                 <log loggingLevel="ERROR"
25                      message="GET CDS request FAILED: ${exception.stacktrace}" />
26             </doCatch>
27             <doFinally>
28                 <to uri="direct:reset-raise-http-exception-flag"/>
29                 <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
30             </doFinally>
31         </doTry>
32     </route>
33     <route id="get-blueprint-workflow-input-properties">
34         <from uri="direct:get-blueprint-workflow-input-properties"/>
35         <log loggingLevel="INFO"
36              message="Getting blueprint input properties for workflow"/>
37         <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeLog('CDS', 'Getting input properties for workflow')"/>
38         <doTry>
39             <setHeader headerName="CamelHttpMethod">
40                 <constant>POST</constant>
41             </setHeader>
42             <setHeader headerName="Content-Type">
43                 <constant>application/json</constant>
44             </setHeader>
45             <log loggingLevel="INFO"
46                  message="Endpoint to query input properties for workflow from CDS : {{clamp.config.cds.url}}/api/v1/blueprint-model/workflow-spec"></log>
47             <toD uri="{{clamp.config.cds.url}}/api/v1/blueprint-model/workflow-spec?bridgeEndpoint=true&amp;useSystemProperties=true&amp;throwExceptionOnFailure=${exchangeProperty[raiseHttpExceptionFlag]}&amp;authMethod=Basic&amp;authUsername={{clamp.config.cds.userName}}&amp;authPassword={{clamp.config.cds.password}}&amp;connectionTimeToLive=5000&amp;httpClient.connectTimeout=10000&amp;httpClient.socketTimeout=30000&amp;authenticationPreemptive=true&amp;connectionClose=true"/>
48             <convertBodyTo type="java.lang.String"/>
49             <doCatch>
50                 <exception>java.lang.Exception</exception>
51                 <handled>
52                     <constant>true</constant>
53                 </handled>
54
55                 <log loggingLevel="ERROR"
56                      message="GET CDS workflow input request FAILED: ${exception.stacktrace}" />
57             </doCatch>
58             <doFinally>
59                 <to uri="direct:reset-raise-http-exception-flag"/>
60                 <to uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=invokeReturnLog()"/>
61             </doFinally>
62         </doTry>
63     </route>
64 </routes>