diff options
author | Ola Aunrønning <olaa@verizonmedia.com> | 2020-01-08 13:53:28 +0100 |
---|---|---|
committer | Ola Aunrønning <olaa@verizonmedia.com> | 2020-01-08 13:53:28 +0100 |
commit | 623eb417c98ee2595faa877777a97d9ca99191d0 (patch) | |
tree | 5ce00c54f3a781b064aa4a4480436d498e82018e /controller-api | |
parent | 406295ad6bfcd050017a4b4b90c2854b9f84e48d (diff) |
Add wantToDeprovision and wantToRetire fields to Node
Diffstat (limited to 'controller-api')
2 files changed, 31 insertions, 3 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 43fea2b76fd..8bb5775566a 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 @@ -37,11 +37,13 @@ public class Node { private final String flavor; private final String clusterId; private final ClusterType clusterType; + private final boolean wantToRetire; + private final boolean wantToDeprovision; public Node(HostName hostname, Optional<HostName> parentHostname, State state, NodeType type, NodeResources resources, Optional<ApplicationId> owner, Version currentVersion, Version wantedVersion, Version currentOsVersion, Version wantedOsVersion, ServiceState serviceState, long restartGeneration, long wantedRestartGeneration, long rebootGeneration, long wantedRebootGeneration, - int cost, String flavor, String clusterId, ClusterType clusterType) { + int cost, String flavor, String clusterId, ClusterType clusterType, boolean wantToRetire, boolean wantToDeprovision) { this.hostname = hostname; this.parentHostname = parentHostname; this.state = state; @@ -61,6 +63,8 @@ public class Node { this.flavor = flavor; this.clusterId = clusterId; this.clusterType = clusterType; + this.wantToRetire = wantToRetire; + this.wantToDeprovision = wantToDeprovision; } public HostName hostname() { @@ -137,6 +141,14 @@ public class Node { return clusterType; } + public boolean wantToRetire() { + return wantToRetire; + } + + public boolean wantToDeprovision() { + return wantToDeprovision; + } + @Override public boolean equals(Object o) { if (this == o) return true; @@ -198,6 +210,8 @@ public class Node { private String flavor; private String clusterId; private ClusterType clusterType; + private boolean wantToRetire; + private boolean wantToDeprovision; public Builder() { } @@ -221,6 +235,8 @@ public class Node { this.flavor = node.flavor; this.clusterId = node.clusterId; this.clusterType = node.clusterType; + this.wantToRetire = node.wantToRetire; + this.wantToDeprovision = node.wantToDeprovision; } public Builder hostname(HostName hostname) { @@ -318,10 +334,20 @@ public class Node { return this; } + public Builder wantToRetire(boolean wantToRetire) { + this.wantToRetire = wantToRetire; + return this; + } + + public Builder wantToDeprovision(boolean wantToDeprovision) { + this.wantToDeprovision = wantToDeprovision; + return this; + } + public Node build() { return new Node(hostname, parentHostname, state, type, resources, owner, currentVersion, wantedVersion, currentOsVersion, wantedOsVersion, serviceState, restartGeneration, wantedRestartGeneration, rebootGeneration, wantedRebootGeneration, - cost, flavor, clusterId, clusterType); + cost, flavor, clusterId, clusterType, wantToRetire, wantToDeprovision); } } } diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/NodeRepository.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/NodeRepository.java index d8b6b1be5ce..dd99bef5ee2 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/NodeRepository.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/NodeRepository.java @@ -105,7 +105,9 @@ public interface NodeRepository { toInt(node.getCost()), node.getFlavor(), clusterIdOf(node.getMembership()), - clusterTypeOf(node.getMembership())); + clusterTypeOf(node.getMembership()), + node.getWantToRetire(), + node.getWantToDeprovision()); } private static String clusterIdOf(NodeMembership nodeMembership) { |