aboutsummaryrefslogtreecommitdiffstats
path: root/controller-api/src
diff options
context:
space:
mode:
authorValerij Fredriksen <valerijf@yahooinc.com>2023-01-05 16:29:12 +0100
committerValerij Fredriksen <valerijf@yahooinc.com>2023-01-05 16:29:12 +0100
commit920081ca836509881ea9eca2c04cef7670e5cffd (patch)
tree9fa14dcabe4d338894c5b6ace370703b80cfdf71 /controller-api/src
parent50aa6b017e14e524930b5feaee1604064a03fdeb (diff)
Add exclusiveToCluterType to controller-api Node
Diffstat (limited to 'controller-api/src')
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/Node.java16
-rw-r--r--controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/noderepository/NodeRepositoryNode.java6
2 files changed, 20 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 3355f765f42..a26e7cce29a 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
@@ -66,6 +66,7 @@ public class Node {
private final boolean down;
private final Optional<TenantName> reservedTo;
private final Optional<ApplicationId> exclusiveTo;
+ private final Optional<ClusterType> exclusiveToClusterType;
private final Map<String, String> reports;
private final List<Event> history;
private final Set<String> ipAddresses;
@@ -83,7 +84,7 @@ public class Node {
long wantedRebootGeneration, int cost, int failCount, Optional<String> flavor, String clusterId,
ClusterType clusterType, String group, int index, boolean retired, boolean wantToRetire, boolean wantToDeprovision,
boolean wantToRebuild, boolean down, Optional<TenantName> reservedTo, Optional<ApplicationId> exclusiveTo,
- DockerImage wantedDockerImage, DockerImage currentDockerImage, Map<String, String> reports,
+ DockerImage wantedDockerImage, DockerImage currentDockerImage, Optional<ClusterType> exclusiveToClusterType, Map<String, String> reports,
List<Event> history, Set<String> ipAddresses, Set<String> additionalIpAddresses,
Set<String> additionalHostnames, Optional<String> switchHostname,
Optional<String> modelName, Environment environment) {
@@ -118,6 +119,7 @@ public class Node {
this.wantToRetire = wantToRetire;
this.wantToDeprovision = wantToDeprovision;
this.reservedTo = Objects.requireNonNull(reservedTo, "reservedTo must be non-null");
+ this.exclusiveToClusterType = Objects.requireNonNull(exclusiveToClusterType, "exclusiveToClusterType");
this.exclusiveTo = Objects.requireNonNull(exclusiveTo, "exclusiveTo must be non-null");
this.wantedDockerImage = Objects.requireNonNull(wantedDockerImage, "wantedDockerImage must be non-null");
this.currentDockerImage = Objects.requireNonNull(currentDockerImage, "currentDockerImage must be non-null");
@@ -301,6 +303,9 @@ public class Node {
/** The application this has been provisioned exclusively for, if any */
public Optional<ApplicationId> exclusiveTo() { return exclusiveTo; }
+ /** The cluster type this has been provisioned exclusively for, if any */
+ public Optional<ClusterType> exclusiveToClusterType() { return exclusiveToClusterType; }
+
/** Returns the reports of this node. Key is the report ID. Value is untyped, but is typically a JSON string */
public Map<String, String> reports() {
return reports;
@@ -487,6 +492,7 @@ public class Node {
private boolean down = false;
private Optional<TenantName> reservedTo = Optional.empty();
private Optional<ApplicationId> exclusiveTo = Optional.empty();
+ private Optional<ClusterType> exclusiveToClusterType = Optional.empty();
private Map<String, String> reports = Map.of();
private List<Event> history = List.of();
private Set<String> ipAddresses = Set.of();
@@ -535,6 +541,7 @@ public class Node {
this.down = node.down;
this.reservedTo = node.reservedTo;
this.exclusiveTo = node.exclusiveTo;
+ this.exclusiveToClusterType = node.exclusiveToClusterType;
this.reports = node.reports;
this.history = node.history;
this.ipAddresses = node.ipAddresses;
@@ -733,6 +740,11 @@ public class Node {
return this;
}
+ public Builder exclusiveToClusterType(ClusterType exclusiveToClusterType) {
+ this.exclusiveToClusterType = Optional.of(exclusiveToClusterType);
+ return this;
+ }
+
public Builder history(List<Event> history) {
this.history = history;
return this;
@@ -779,7 +791,7 @@ public class Node {
suspendedSince, restartGeneration, wantedRestartGeneration, rebootGeneration,
wantedRebootGeneration, cost, failCount, flavor, clusterId, clusterType, group, index, retired,
wantToRetire, wantToDeprovision, wantToRebuild, down, reservedTo, exclusiveTo, wantedDockerImage,
- currentDockerImage, reports, history, ipAddresses, additionalIpAddresses,
+ currentDockerImage, exclusiveToClusterType, 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 e8cd4c72044..6e5db0fd615 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
@@ -105,6 +105,8 @@ public class NodeRepositoryNode {
private String reservedTo;
@JsonProperty("exclusiveTo")
private String exclusiveTo;
+ @JsonProperty("exclusiveToClusterType")
+ private String exclusiveToClusterType;
@JsonProperty("switchHostname")
private String switchHostname;
@JsonProperty("cloudAccount")
@@ -434,6 +436,10 @@ public class NodeRepositoryNode {
public void setExclusiveTo(String exclusiveTo) { this.exclusiveTo = exclusiveTo; }
+ public String getExclusiveToClusterType() { return exclusiveToClusterType; }
+
+ public void setExclusiveToClusterType(String exclusiveToClusterType) { this.exclusiveToClusterType = exclusiveToClusterType; }
+
public String getSwitchHostname() {
return switchHostname;
}