summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/application
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2019-11-07 15:06:03 +0000
committerGerrit Code Review <gerrit@onap.org>2019-11-07 15:06:03 +0000
commit9e374a0b49cdfd3594a32ff062e210765cad14ea (patch)
treec10cc6803dab6536ee6b3d64c41e40f99358c115 /ms/blueprintsprocessor/application
parent59d3681b80e9b5f9e69b4492138ab1f056a0351d (diff)
parent843d1f7ec7c45e3aad1d5198b776bb99a235448d (diff)
Merge "Update on Health-api"
Diffstat (limited to 'ms/blueprintsprocessor/application')
-rwxr-xr-xms/blueprintsprocessor/application/pom.xml11
-rw-r--r--ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/actuator/indicator/BluePrintCustomIndicator.kt47
-rwxr-xr-xms/blueprintsprocessor/application/src/main/resources/application.properties23
-rw-r--r--ms/blueprintsprocessor/application/src/test/resources/application-test.properties14
-rw-r--r--ms/blueprintsprocessor/application/src/test/resources/application.properties4
5 files changed, 93 insertions, 6 deletions
diff --git a/ms/blueprintsprocessor/application/pom.xml b/ms/blueprintsprocessor/application/pom.xml
index 0ee6ac339..dc0e49fd7 100755
--- a/ms/blueprintsprocessor/application/pom.xml
+++ b/ms/blueprintsprocessor/application/pom.xml
@@ -84,12 +84,16 @@
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
<artifactId>configs-api</artifactId>
</dependency>
- <!--
- <dependency>
+ <dependency>
<groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
<artifactId>health-api</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.ccsdk.cds.blueprintsprocessor</groupId>
+ <artifactId>health-api-common</artifactId>
+ <version>0.7.0-SNAPSHOT</version>
</dependency>
- -->
<!-- Functions -->
<dependency>
@@ -180,6 +184,7 @@
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</dependency>
+
</dependencies>
<build>
diff --git a/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/actuator/indicator/BluePrintCustomIndicator.kt b/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/actuator/indicator/BluePrintCustomIndicator.kt
new file mode 100644
index 000000000..66a19b2c5
--- /dev/null
+++ b/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/actuator/indicator/BluePrintCustomIndicator.kt
@@ -0,0 +1,47 @@
+/*
+ * Copyright © 2019-2020 Orange.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.cds.blueprintsprocessor.actuator.indicator
+
+import org.onap.ccsdk.cds.blueprintsprocessor.healthapi.domain.HealthApiResponse
+import org.onap.ccsdk.cds.blueprintsprocessor.healthapi.domain.HealthCheckStatus
+import org.onap.ccsdk.cds.blueprintsprocessor.healthapi.service.health.BluePrintProcessorHealthCheck
+import org.springframework.boot.actuate.health.AbstractHealthIndicator
+import org.springframework.boot.actuate.health.Health
+import org.springframework.stereotype.Component
+
+/**
+ * Health Indicator for BluePrintProcessor.
+ * @author Shaaban Ebrahim
+ * @version 1.0
+ */
+@Component
+open class BluePrintCustomIndicator(private val bluePrintProcessorHealthCheck: BluePrintProcessorHealthCheck)
+ : AbstractHealthIndicator() {
+
+ @Throws(Exception::class)
+ override fun doHealthCheck(builder: Health.Builder) {
+ var result: HealthApiResponse? = bluePrintProcessorHealthCheck!!.retrieveEndpointExecutionStatus()
+ if (result?.status == HealthCheckStatus.UP) {
+ builder.up()
+ } else {
+ builder.down()
+ }
+ builder.withDetail("Services", result?.checks)
+ }
+
+
+}
diff --git a/ms/blueprintsprocessor/application/src/main/resources/application.properties b/ms/blueprintsprocessor/application/src/main/resources/application.properties
index b8f0d2344..6708dcf69 100755
--- a/ms/blueprintsprocessor/application/src/main/resources/application.properties
+++ b/ms/blueprintsprocessor/application/src/main/resources/application.properties
@@ -107,4 +107,25 @@ blueprintsprocessor.messageconsumer.self-service-api.pollMillSec=1000
blueprintsprocessor.messageproducer.self-service-api.type=kafka-basic-auth
blueprintsprocessor.messageproducer.self-service-api.bootstrapServers=127.0.0.1:9092
blueprintsprocessor.messageproducer.self-service-api.clientId=default-client-id
-blueprintsprocessor.messageproducer.self-service-api.topic=producer.t \ No newline at end of file
+blueprintsprocessor.messageproducer.self-service-api.topic=producer.t
+
+
+blueprintprocessor.remoteScriptCommand.enabled=true
+
+#Encrypted username and password for health check service
+endpoints.user.name=eHbVUbJAj4AG2522cSbrOQ==
+endpoints.user.password=eHbVUbJAj4AG2522cSbrOQ==
+
+#BaseUrls for health check blueprint processor services
+blueprintprocessor.healthcheck.baseUrl=http://localhost:8080/
+blueprintprocessor.healthcheck.mapping-service-name-with-service-link=[Execution service,/api/v1/execution-service/health-check],[Resources service,/api/v1/resources/health-check],[Template service,/api/v1/template/health-check]
+
+#BaseUrls for health check Cds Listener services
+cdslistener.healthcheck.baseUrl=http://cds-sdc-listener:8080/
+cdslistener.healthcheck.mapping-service-name-with-service-link=[SDC Listener service,/api/v1/sdclistener/healthcheck]
+
+#Actuator properties
+management.endpoints.web.exposure.include=*
+management.endpoint.health.show-details=always
+
+
diff --git a/ms/blueprintsprocessor/application/src/test/resources/application-test.properties b/ms/blueprintsprocessor/application/src/test/resources/application-test.properties
index 0f3457454..1d2565be3 100644
--- a/ms/blueprintsprocessor/application/src/test/resources/application-test.properties
+++ b/ms/blueprintsprocessor/application/src/test/resources/application-test.properties
@@ -48,3 +48,17 @@ blueprintsprocessor.cliExecutor.enabled=true
blueprintsprocessor.netconfExecutor.enabled=true
blueprintsprocessor.restconfEnabled=true
+
+
+#Encrypted username and password for health check service
+endpoints.user.name=eHbVUbJAj4AG2522cSbrOQ==
+endpoints.user.password=eHbVUbJAj4AG2522cSbrOQ==
+
+#BaseUrls for health check blueprint processor services
+blueprintprocessor.healthcheck.baseUrl=http://localhost:8080/
+blueprintprocessor.healthcheck.mapping-service-name-with-service-link=[Execution service,/api/v1/execution-service/health-check],[Resources service,/api/v1/resources/health-check],[Template service,/api/v1/template/health-check]
+
+#BaseUrls for health check Cds Listener services
+cdslistener.healthcheck.baseUrl=http://cds-sdc-listener:8080/
+cdslistener.healthcheck.mapping-service-name-with-service-link=[SDC Listener service,/api/v1/sdclistener/healthcheck]
+
diff --git a/ms/blueprintsprocessor/application/src/test/resources/application.properties b/ms/blueprintsprocessor/application/src/test/resources/application.properties
index 92d54f6f5..ea14c493a 100644
--- a/ms/blueprintsprocessor/application/src/test/resources/application.properties
+++ b/ms/blueprintsprocessor/application/src/test/resources/application.properties
@@ -79,5 +79,5 @@ blueprintsprocessor.messageclient.self-service-api.clientId=default-client-id
blueprintsprocessor.messageclient.self-service-api.kafkaEnable=false
-endpoints.user.name=ccsdkapps
-endpoints.user.password=ccsdkapps
+endpoints.user.name=eHbVUbJAj4AG2522cSbrOQ==
+endpoints.user.password=eHbVUbJAj4AG2522cSbrOQ==