diff options
Diffstat (limited to 'service-monitor/src/main/java/com/yahoo/vespa/service/health/HealthResponse.java')
-rw-r--r-- | service-monitor/src/main/java/com/yahoo/vespa/service/health/HealthResponse.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/service-monitor/src/main/java/com/yahoo/vespa/service/health/HealthResponse.java b/service-monitor/src/main/java/com/yahoo/vespa/service/health/HealthResponse.java new file mode 100644 index 00000000000..5d97d773a53 --- /dev/null +++ b/service-monitor/src/main/java/com/yahoo/vespa/service/health/HealthResponse.java @@ -0,0 +1,35 @@ +// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.service.health; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.yahoo.text.JSON; + +/** + * Response entity from /state/v1/health + * + * @author hakon + */ +@JsonIgnoreProperties(ignoreUnknown = true) +public class HealthResponse { + @JsonProperty("status") + public Status status = new Status(); + + @JsonIgnoreProperties(ignoreUnknown = true) + public static class Status { + public static final String DEFAULT_STATUS = "down"; + + @JsonProperty("code") + public String code = DEFAULT_STATUS; + + @Override + public String toString() { + return "{ \"code\": \"" + JSON.escape(code) + "\" }"; + } + } + + @Override + public String toString() { + return "{ \"status\": " + status.toString() + " }"; + } +} |