-
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathHealthController.java
59 lines (54 loc) · 2.09 KB
/
HealthController.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package com.czertainly.api.interfaces.connector;
import com.czertainly.api.model.common.ErrorMessageDto;
import com.czertainly.api.model.common.HealthDto;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/v1/health")
@Tag(
name = "Health check",
description = "Connector Health check API. " +
"Connector returns own status and in some cases " +
"can return status of services on which it depends like database, HSM and so on."
)
@ApiResponses(
value = {
@ApiResponse(
responseCode = "400",
description = "Bad Request",
content = @Content(schema = @Schema(implementation = ErrorMessageDto.class))
),
@ApiResponse(
responseCode = "404",
description = "Not Found",
content = @Content(schema = @Schema(implementation = ErrorMessageDto.class))
),
@ApiResponse(
responseCode = "500",
description = "Internal Server Error",
content = @Content
)
})
public interface HealthController {
@GetMapping(
produces = {"application/json"}
)
@Operation(
summary = "Health check"
)
@ApiResponses(
value = {
@ApiResponse(
responseCode = "200",
description = "Health check completed successfully"
)
})
HealthDto checkHealth();
}