blob: 39fab92d02c171d9440f5d9dfd6509fb6951b9f0 (
plain) (
blame)
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
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.clustercontroller.core.status;
import com.yahoo.vespa.clustercontroller.core.status.statuspage.StatusPageResponse;
import com.yahoo.vespa.clustercontroller.core.status.statuspage.StatusPageServer;
/**
* @author Haakon Humberset
*/
public class NodeHealthRequestHandler implements StatusPageServer.RequestHandler {
private final RunDataExtractor data;
public NodeHealthRequestHandler(RunDataExtractor data) {
this.data = data;
}
@Override
public StatusPageResponse handle(StatusPageServer.HttpRequest request) {
StatusPageResponse response = new StatusPageResponse();
response.setContentType("application/json");
response.writeContent("{\n" +
" \"status\" : {\n" +
" \"code\" : \"up\"\n" +
" },\n" +
" \"config\" : {\n" +
" \"component\" : {\n" +
" \"generation\" : " + data.getConfigGeneration() + "\n" +
" }\n" +
" }\n" +
"}");
return response;
}
}
|