diff options
3 files changed, 28 insertions, 2 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Node.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Node.java index c5d3fd1374f..bb97349e5dd 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Node.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Node.java @@ -61,6 +61,7 @@ public class Node { private final boolean wantToRetire; private final boolean wantToDeprovision; private final boolean wantToRebuild; + private final boolean down; private final Optional<TenantName> reservedTo; private final Optional<ApplicationId> exclusiveTo; private final Map<String, String> reports; @@ -79,7 +80,7 @@ public class Node { long restartGeneration, long wantedRestartGeneration, long rebootGeneration, long wantedRebootGeneration, int cost, int failCount, Optional<String> flavor, String clusterId, ClusterType clusterType, String group, boolean retired, boolean wantToRetire, boolean wantToDeprovision, - boolean wantToRebuild, Optional<TenantName> reservedTo, Optional<ApplicationId> exclusiveTo, + boolean wantToRebuild, boolean down, Optional<TenantName> reservedTo, Optional<ApplicationId> exclusiveTo, DockerImage wantedDockerImage, DockerImage currentDockerImage, Map<String, String> reports, List<Event> history, Set<String> ipAddresses, Set<String> additionalIpAddresses, Set<String> additionalHostnames, Optional<String> switchHostname, @@ -117,6 +118,7 @@ public class Node { this.wantedDockerImage = Objects.requireNonNull(wantedDockerImage, "wantedDockerImage must be non-null"); this.currentDockerImage = Objects.requireNonNull(currentDockerImage, "currentDockerImage must be non-null"); this.wantToRebuild = wantToRebuild; + this.down = down; this.reports = Map.copyOf(Objects.requireNonNull(reports, "reports must be non-null")); this.history = List.copyOf(Objects.requireNonNull(history, "history must be non-null")); this.ipAddresses = Set.copyOf(Objects.requireNonNull(ipAddresses, "ipAddresses must be non-null")); @@ -280,6 +282,11 @@ public class Node { return wantToRebuild; } + /** Whether this node is currently down */ + public boolean down() { + return down; + } + /** The tenant this has been reserved to, if any */ public Optional<TenantName> reservedTo() { return reservedTo; } @@ -467,6 +474,7 @@ public class Node { private boolean wantToRetire = false; private boolean wantToDeprovision = false; private boolean wantToRebuild = false; + private boolean down = false; private Optional<TenantName> reservedTo = Optional.empty(); private Optional<ApplicationId> exclusiveTo = Optional.empty(); private Map<String, String> reports = Map.of(); @@ -512,6 +520,7 @@ public class Node { this.wantToRetire = node.wantToRetire; this.wantToDeprovision = node.wantToDeprovision; this.wantToRebuild = node.wantToRebuild; + this.down = node.down; this.reservedTo = node.reservedTo; this.exclusiveTo = node.exclusiveTo; this.reports = node.reports; @@ -687,6 +696,11 @@ public class Node { return this; } + public Builder down(boolean down) { + this.down = down; + return this; + } + public Builder reservedTo(TenantName tenant) { this.reservedTo = Optional.of(tenant); return this; @@ -742,7 +756,7 @@ public class Node { currentOsVersion, wantedOsVersion, currentFirmwareCheck, wantedFirmwareCheck, serviceState, suspendedSince, restartGeneration, wantedRestartGeneration, rebootGeneration, wantedRebootGeneration, cost, failCount, flavor, clusterId, clusterType, group, retired, - wantToRetire, wantToDeprovision, wantToRebuild, reservedTo, exclusiveTo, wantedDockerImage, + wantToRetire, wantToDeprovision, wantToRebuild, down, reservedTo, exclusiveTo, wantedDockerImage, currentDockerImage, reports, history, ipAddresses, additionalIpAddresses, additionalHostnames, switchHostname, modelName, environment); } diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/NodeRepositoryNode.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/NodeRepositoryNode.java index 71f08f7318d..8964e1b5127 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/NodeRepositoryNode.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/NodeRepositoryNode.java @@ -85,6 +85,8 @@ public class NodeRepositoryNode { private Boolean wantToDeprovision; @JsonProperty("wantToRebuild") private Boolean wantToRebuild; + @JsonProperty("down") + private Boolean down; @JsonProperty("cost") private Integer cost; @JsonProperty("history") @@ -318,6 +320,14 @@ public class NodeRepositoryNode { this.wantToRebuild = wantToRebuild; } + public Boolean getDown() { + return down; + } + + public void setDown(Boolean down) { + this.down = down; + } + public Integer getCost() { return cost; } @@ -465,6 +475,7 @@ public class NodeRepositoryNode { ", wantToRetire=" + wantToRetire + ", wantToDeprovision=" + wantToDeprovision + ", wantToRebuild=" + wantToRebuild + + ", down=" + down + ", cost=" + cost + ", history=" + history + ", orchestratorStatus='" + orchestratorStatus + '\'' + diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java index bba9e4fb1f9..6116321cda5 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java @@ -1119,6 +1119,7 @@ public class ApplicationApiHandler extends AuditLoggingRequestHandler { nodeObject.setString("clusterId", node.clusterId()); nodeObject.setString("clusterType", valueOf(node.clusterType())); nodeObject.setBool("down", !isUp); +// nodeObject.setBool("down", node.down()); // TODO (valerijf): Enable when all configservers expose this nodeObject.setBool("retired", node.retired() || node.wantToRetire()); nodeObject.setBool("restarting", node.wantedRestartGeneration() > node.restartGeneration()); nodeObject.setBool("rebooting", node.wantedRebootGeneration() > node.rebootGeneration()); |