2 * Copyright © 2019-2020 Orange.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.onap.ccsdk.cds.blueprintsprocessor.healthapi.controller
19 import io.swagger.annotations.Api
20 import io.swagger.annotations.ApiOperation
21 import org.onap.ccsdk.cds.blueprintsprocessor.healthapi.domain.MetricsInfo
22 import org.onap.ccsdk.cds.blueprintsprocessor.healthapi.service.CombinedMetricsService
23 import org.springframework.http.MediaType
24 import org.springframework.http.ResponseEntity
25 import org.springframework.web.bind.annotation.RequestMapping
26 import org.springframework.web.bind.annotation.RequestMethod
27 import org.springframework.web.bind.annotation.ResponseBody
28 import org.springframework.web.bind.annotation.RestController
31 * Exposes API for checking Metrics of BluePrint processor and CDSListener.
33 * @author Shaaban Ebrahim
37 @RequestMapping("/api/v1/combinedMetrics")
39 value = "/api/v1/combinedMetrics",
40 description = "gather all Metrics info from BluePrint and CDSListener"
42 open class CombinedMetrics(private val combinedMetricsService: CombinedMetricsService) {
46 method = [RequestMethod.GET],
47 produces = [MediaType.APPLICATION_JSON_VALUE]
50 @ApiOperation(value = " Metrics Check", hidden = true)
51 fun getMetricsHealthCheckResponse(): ResponseEntity<MetricsInfo?> {
52 return ResponseEntity.ok().body(combinedMetricsService.metricsInfo)