From 5b9d6018431f09d090b71fa3179a9d9bed5dc0ab Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Mon, 28 Aug 2017 22:47:50 +0200 Subject: SONAR-9739 add protobuf response to WS api/system/status --- .../org/sonarqube/ws/client/system/SystemService.java | 4 ++++ sonar-ws/src/main/protobuf/ws-system.proto | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) (limited to 'sonar-ws/src/main') diff --git a/sonar-ws/src/main/java/org/sonarqube/ws/client/system/SystemService.java b/sonar-ws/src/main/java/org/sonarqube/ws/client/system/SystemService.java index ef31bfaed45..cb8c55aec61 100644 --- a/sonar-ws/src/main/java/org/sonarqube/ws/client/system/SystemService.java +++ b/sonar-ws/src/main/java/org/sonarqube/ws/client/system/SystemService.java @@ -37,4 +37,8 @@ public class SystemService extends BaseService { public void restart() { call(new PostRequest(path("restart"))); } + + public WsSystem.StatusResponse status() { + return call(new GetRequest(path("status")), WsSystem.StatusResponse.parser()); + } } diff --git a/sonar-ws/src/main/protobuf/ws-system.proto b/sonar-ws/src/main/protobuf/ws-system.proto index 4f0fd9af5fc..39ad9210eb7 100644 --- a/sonar-ws/src/main/protobuf/ws-system.proto +++ b/sonar-ws/src/main/protobuf/ws-system.proto @@ -30,6 +30,13 @@ message HealthResponse { repeated Cause causes = 2; } +// GET api/system/status +message StatusResponse { + optional string id = 1; + optional string version = 2; + optional Status status = 3; +} + message Cause { optional string message = 1; } @@ -39,3 +46,12 @@ enum Health { YELLOW = 1; RED = 2; } + +enum Status { + STARTING = 0; + UP = 1; + DOWN = 2; + RESTARTING = 3; + DB_MIGRATION_NEEDED = 4; + DB_MIGRATION_RUNNING = 5; +} -- cgit v1.2.3