aboutsummaryrefslogtreecommitdiffstats
path: root/ms
diff options
context:
space:
mode:
Diffstat (limited to 'ms')
-rw-r--r--ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BluePrintCoreConfiguration.kt11
-rw-r--r--ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt9
-rw-r--r--ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt6
-rw-r--r--ms/blueprintsprocessor/modules/inbounds/health-api-common/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/configuration/HealthCheckProperties.kt4
-rw-r--r--ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/SdcListenerApplication.java3
-rw-r--r--ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/actuator/indicator/SDCListenerCustomIndicator.java16
-rw-r--r--ms/sdclistener/application/src/main/resources/application.yaml25
7 files changed, 57 insertions, 17 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BluePrintCoreConfiguration.kt b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BluePrintCoreConfiguration.kt
index 76b37a5b4..95b2c0154 100644
--- a/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BluePrintCoreConfiguration.kt
+++ b/ms/blueprintsprocessor/modules/commons/processor-core/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/core/BluePrintCoreConfiguration.kt
@@ -17,7 +17,9 @@
package org.onap.ccsdk.cds.blueprintsprocessor.core
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.config.BluePrintLoadConfiguration
+import org.onap.ccsdk.cds.controllerblueprints.core.logger
import org.onap.ccsdk.cds.controllerblueprints.core.service.BluePrintDependencyService
import org.slf4j.LoggerFactory
import org.springframework.beans.factory.annotation.Autowired
@@ -60,9 +62,16 @@ open class BluePrintPropertyConfiguration {
@Service
open class BluePrintPropertiesService(private var bluePrintPropertyBinder: Binder) {
+ private val log = logger(BluePrintPropertiesService::class)
fun <T> propertyBeanType(prefix: String, type: Class<T>): T {
- return bluePrintPropertyBinder.bind(prefix, Bindable.of(type)).get()
+ return try {
+ bluePrintPropertyBinder.bind(prefix, Bindable.of(type)).get()
+ } catch (e: NoSuchElementException) {
+ val errMsg = "Error: missing property \"$prefix\"... Check the application.properties file."
+ log.error(errMsg)
+ throw BluePrintProcessorException(e, errMsg)
+ }
}
}
diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt
index f257157c8..0eb29f4cc 100644
--- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt
+++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/BlueprintModelController.kt
@@ -30,6 +30,7 @@ import org.springframework.core.io.Resource
import org.springframework.data.domain.Page
import org.springframework.data.domain.PageRequest
import org.springframework.data.domain.Sort
+import org.springframework.http.HttpStatus
import org.springframework.http.MediaType
import org.springframework.http.ResponseEntity
import org.springframework.http.codec.multipart.FilePart
@@ -129,8 +130,12 @@ open class BlueprintModelController(private val bluePrintModelHandler: BluePrint
@PathVariable(value = "name") name: String,
@PathVariable(value = "version") version: String
):
- Mono<BlueprintModelSearch> = monoMdc {
- bluePrintModelHandler.getBlueprintModelSearchByNameAndVersion(name, version)
+ Mono<ResponseEntity<BlueprintModelSearch>> = monoMdc {
+ var bluePrintModel: BlueprintModelSearch? = bluePrintModelHandler.getBlueprintModelSearchByNameAndVersion(name, version)
+ if (bluePrintModel != null)
+ ResponseEntity(bluePrintModel, HttpStatus.OK)
+ else
+ ResponseEntity(HttpStatus.NO_CONTENT)
}
@GetMapping("/download/by-name/{name}/version/{version}", produces = [MediaType.APPLICATION_JSON_VALUE])
diff --git a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt
index 392fa0bb4..274650ae4 100644
--- a/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt
+++ b/ms/blueprintsprocessor/modules/inbounds/designer-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/designer/api/handler/BluePrintModelHandler.kt
@@ -145,12 +145,12 @@ open class BluePrintModelHandler(
* @throws BluePrintException BluePrintException
*/
@Throws(BluePrintException::class)
- open fun getBlueprintModelSearchByNameAndVersion(name: String, version: String): BlueprintModelSearch {
+ open fun getBlueprintModelSearchByNameAndVersion(name: String, version: String): BlueprintModelSearch? {
return blueprintModelSearchRepository.findByArtifactNameAndArtifactVersion(name, version)
- ?: throw BluePrintException(
+ /*?: throw BluePrintException(
ErrorCode.RESOURCE_NOT_FOUND.value,
String.format(BLUEPRINT_MODEL_NAME_VERSION_FAILURE_MSG, name, version)
- )
+ )*/
}
/**
diff --git a/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/configuration/HealthCheckProperties.kt b/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/configuration/HealthCheckProperties.kt
index f64cba88b..c1532cd35 100644
--- a/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/configuration/HealthCheckProperties.kt
+++ b/ms/blueprintsprocessor/modules/inbounds/health-api-common/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/healthapi/configuration/HealthCheckProperties.kt
@@ -52,7 +52,7 @@ open class HealthCheckProperties {
}
open fun getCDSListenerServiceInformation(): List<ServiceEndpoint> {
- val serviceName = ServiceName.BLUEPRINT
+ val serviceName = ServiceName.CDSLISTENER
return getListOfServiceEndPoints(cdsListenerServiceMapping, serviceName)
}
@@ -78,7 +78,7 @@ open class HealthCheckProperties {
private fun getServiceEndpoint(serviceEndpointInfo: List<String>): ServiceEndpoint {
return ServiceEndpoint(
- removeSpecialCharacter(serviceEndpointInfo.get(0)), removeSpecialCharacter(serviceEndpointInfo.get(1))
+ removeSpecialCharacter(serviceEndpointInfo[0]), removeSpecialCharacter(serviceEndpointInfo[1])
)
}
diff --git a/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/SdcListenerApplication.java b/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/SdcListenerApplication.java
index 2ec241d75..04cbebe7a 100644
--- a/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/SdcListenerApplication.java
+++ b/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/SdcListenerApplication.java
@@ -19,11 +19,14 @@ package org.onap.ccsdk.cds.sdclistener;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
@EnableConfigurationProperties(SdcListenerConfiguration.class)
+@ComponentScan(basePackages = {"org.onap.ccsdk.cds.blueprintsprocessor.healthapi","org.onap.ccsdk.cds.sdclistener"})
public class SdcListenerApplication {
public static void main(String[] args) {
+
SpringApplication.run(SdcListenerApplication.class, args);
}
diff --git a/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/actuator/indicator/SDCListenerCustomIndicator.java b/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/actuator/indicator/SDCListenerCustomIndicator.java
index 1a5bafcc8..57585125e 100644
--- a/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/actuator/indicator/SDCListenerCustomIndicator.java
+++ b/ms/sdclistener/application/src/main/java/org/onap/ccsdk/cds/sdclistener/actuator/indicator/SDCListenerCustomIndicator.java
@@ -20,8 +20,8 @@ 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.SDCListenerHealthCheck;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.boot.actuate.health.AbstractHealthIndicator;
-import org.springframework.boot.actuate.health.Health.Builder;
+import org.springframework.boot.actuate.health.Health;
+import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.stereotype.Component;
/**
@@ -31,20 +31,18 @@ import org.springframework.stereotype.Component;
* @version 1.0
*/
@Component
-public class SDCListenerCustomIndicator extends AbstractHealthIndicator {
+public class SDCListenerCustomIndicator implements HealthIndicator {
@Autowired
private SDCListenerHealthCheck sDCListenerHealthCheck;
@Override
- protected void doHealthCheck(Builder builder) {
+ public Health health() {
HealthApiResponse healthAPIResponse = sDCListenerHealthCheck.retrieveEndpointExecutionStatus();
if (healthAPIResponse.getStatus() == HealthCheckStatus.UP) {
- builder.up();
- } else {
- builder.down();
+
+ return Health.up().withDetail("Services", healthAPIResponse.getChecks()).build();
}
- builder.withDetail("Services", healthAPIResponse.getChecks());
+ return Health.down().build();
}
-
}
diff --git a/ms/sdclistener/application/src/main/resources/application.yaml b/ms/sdclistener/application/src/main/resources/application.yaml
index b3f8443eb..424f0a5c0 100644
--- a/ms/sdclistener/application/src/main/resources/application.yaml
+++ b/ms/sdclistener/application/src/main/resources/application.yaml
@@ -25,3 +25,28 @@ server:
spring:
main:
web-environment: ${sprintWebListenerEnabled:true}
+
+
+
+cdslistener:
+ healthcheck:
+ baseUrl: http://localhost:9000/
+#servicename = SDC Listener service and service link = /api/v1/sdclistener/healthcheck (this is used to check if sdclistener is up depending on all services status)
+#if you want to add more service it will like [service-name,service-link],[],[]
+ mapping-service-name-with-service-link: "[SDC Listener service,/api/v1/sdclistener/healthcheck]"
+
+management:
+ endpoint:
+ health:
+ show-details: always
+
+
+ endpoints:
+ web:
+ exposure:
+ include: "*"
+
+endpoints:
+ user:
+ name: eHbVUbJAj4AG2522cSbrOQ==
+ password: eHbVUbJAj4AG2522cSbrOQ==