aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/resources
diff options
context:
space:
mode:
authorsebdet <sebastien.determe@intl.att.com>2019-09-10 15:57:10 +0200
committersebdet <sebastien.determe@intl.att.com>2019-09-10 16:50:30 +0200
commitc85d40b0cc8f40e5d0e17019878df82170f7bb35 (patch)
treea99cefc721df797a485c3ca57b0f85ad3ef4ae3d /src/main/resources
parentceaa2fc1fee98ca995e1952f107d098633f01eb7 (diff)
Repair healthcheck
HealthCheck was always returning 200 even if the db was not up and running Issue-ID: CLAMP-494 Change-Id: I85aa427a212c6cde568d3863d1ab1a1a11c71f16 Signed-off-by: sebdet <sebastien.determe@intl.att.com>
Diffstat (limited to 'src/main/resources')
-rw-r--r--src/main/resources/META-INF/resources/swagger.html2
-rw-r--r--src/main/resources/clds/camel/rest/clamp-api-v2.xml2
-rw-r--r--src/main/resources/clds/camel/rest/clds-services.xml26
3 files changed, 20 insertions, 10 deletions
diff --git a/src/main/resources/META-INF/resources/swagger.html b/src/main/resources/META-INF/resources/swagger.html
index d2ec9660..d3b38b69 100644
--- a/src/main/resources/META-INF/resources/swagger.html
+++ b/src/main/resources/META-INF/resources/swagger.html
@@ -588,7 +588,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
<div class="sect2">
<h3 id="_uri_scheme"><a class="anchor" href="#_uri_scheme"></a><a class="link" href="#_uri_scheme">1.2. URI scheme</a></h3>
<div class="paragraph">
-<p><em>Host</em> : localhost:40147<br>
+<p><em>Host</em> : localhost:36829<br>
<em>BasePath</em> : /restservices/clds/<br>
<em>Schemes</em> : HTTP</p>
</div>
diff --git a/src/main/resources/clds/camel/rest/clamp-api-v2.xml b/src/main/resources/clds/camel/rest/clamp-api-v2.xml
index 6ee44cad..cf99625e 100644
--- a/src/main/resources/clds/camel/rest/clamp-api-v2.xml
+++ b/src/main/resources/clds/camel/rest/clamp-api-v2.xml
@@ -68,7 +68,7 @@
<to
uri="bean:org.onap.clamp.authorization.AuthorizationController?method=authorize(*,'cl','','read')" />
<to
- uri="bean:org.onap.clamp.loop.LoopController?method=getSVGRepresentation(${header.loopName})" />
+ uri="bean:org.onap.clamp.loop.LoopController?method=getSvgRepresentation(${header.loopName})" />
<to
uri="bean:org.onap.clamp.flow.log.FlowLogOperation?method=endLog()" />
<doCatch>
diff --git a/src/main/resources/clds/camel/rest/clds-services.xml b/src/main/resources/clds/camel/rest/clds-services.xml
index b3061dc4..dd3a4bfd 100644
--- a/src/main/resources/clds/camel/rest/clds-services.xml
+++ b/src/main/resources/clds/camel/rest/clds-services.xml
@@ -1,19 +1,29 @@
<rests xmlns="http://camel.apache.org/schema/spring">
- <rest >
- <get uri="/v1/clds/cldsInfo"
- outType="org.onap.clamp.clds.model.CldsInfo"
+ <rest>
+ <get uri="/v1/clds/cldsInfo" outType="org.onap.clamp.clds.model.CldsInfo"
produces="application/json">
<to
uri="bean:org.onap.clamp.clds.service.CldsService?method=getCldsInfo()" />
</get>
- <get uri="/v1/healthcheck" produces="application/json">
- <to
- uri="bean:org.onap.clamp.clds.service.CldsHealthcheckService?method=gethealthcheck()" />
+ <get uri="/v1/healthcheck" produces="application/json"
+ outType="org.onap.clamp.clds.model.CldsHealthCheck">
+ <route>
+ <setBody>
+ <method ref="org.onap.clamp.clds.service.CldsHealthcheckService"
+ method="gethealthcheck()" />
+ </setBody>
+ <when>
+ <simple> ${body} == 'NOT-OK'</simple>
+ <setHeader headerName="CamelHttpResponseCode">
+ <constant>404</constant>
+ </setHeader>
+ <log loggingLevel="ERROR" message="HealthCheck failed" />
+ </when>
+ </route>
</get>
<get uri="/v1/user/getUser" produces="text/plain">
- <to
- uri="bean:org.onap.clamp.clds.service.UserService?method=getUser()" />
+ <to uri="bean:org.onap.clamp.clds.service.UserService?method=getUser()" />
</get>
</rest>
</rests>