Revert "Renaming Files having BluePrint to have Blueprint"
[ccsdk/cds.git] / ms / blueprintsprocessor / modules / inbounds / health-api / src / main / kotlin / org / onap / ccsdk / cds / blueprintsprocessor / healthapi / controller / CombinedMetrics.kt
1 /*
2  * Copyright © 2019-2020 Orange.
3  *
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
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 package org.onap.ccsdk.cds.blueprintsprocessor.healthapi.controller
18
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
29
30 /**
31  * Exposes API for checking Metrics of BluePrint processor and CDSListener.
32  *
33  * @author Shaaban Ebrahim
34  * @version 1.0
35  */
36 @RestController
37 @RequestMapping("/api/v1/combinedMetrics")
38 @Api(
39     value = "/api/v1/combinedMetrics",
40     description = "gather all Metrics info from BluePrint and CDSListener"
41 )
42 open class CombinedMetrics(private val combinedMetricsService: CombinedMetricsService) {
43
44     @RequestMapping(
45         path = [""],
46         method = [RequestMethod.GET],
47         produces = [MediaType.APPLICATION_JSON_VALUE]
48     )
49     @ResponseBody
50     @ApiOperation(value = " Metrics Check", hidden = true)
51     fun getMetricsHealthCheckResponse(): ResponseEntity<MetricsInfo?> {
52         return ResponseEntity.ok().body(combinedMetricsService.metricsInfo)
53     }
54 }