diff options
author | Dan Timoney <dtimoney@att.com> | 2019-11-07 15:06:03 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-11-07 15:06:03 +0000 |
commit | 9e374a0b49cdfd3594a32ff062e210765cad14ea (patch) | |
tree | c10cc6803dab6536ee6b3d64c41e40f99358c115 /ms/blueprintsprocessor/application/src | |
parent | 59d3681b80e9b5f9e69b4492138ab1f056a0351d (diff) | |
parent | 843d1f7ec7c45e3aad1d5198b776bb99a235448d (diff) |
Merge "Update on Health-api"
Diffstat (limited to 'ms/blueprintsprocessor/application/src')
4 files changed, 85 insertions, 3 deletions
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== |