summaryrefslogtreecommitdiffstats
path: root/controller-api
diff options
context:
space:
mode:
authorValerij Fredriksen <freva@users.noreply.github.com>2022-04-21 10:49:02 +0200
committerGitHub <noreply@github.com>2022-04-21 10:49:02 +0200
commitab000ee7f0220920e1cdb7964468fcbd1d958dc6 (patch)
treed02ec68ed076ebc5903968286a88a5d55cf84228 /controller-api
parent414af1c79283bdf71b39fa536afe6ca4a9c33fe1 (diff)
parentc955c57941a29aac953e95ff2fcf79363e103465 (diff)
Merge pull request #22174 from vespa-engine/freva/expose-down
Expose down in nodes API
Diffstat (limited to 'controller-api')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Node.java18
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/NodeRepositoryNode.java11
2 files changed, 27 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 + '\'' +