diff options
author | Martin Polden <mpolden@mpolden.no> | 2021-12-02 14:32:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-02 14:32:39 +0100 |
commit | 6b5c9652df7bc095bede29f2ba415abfdbdbcd05 (patch) | |
tree | 9e9c3c3638df0f050c0565910aeb28df77dd6664 /controller-api | |
parent | 4a6a7b274588d88a96c66b0c1ef27274eda8b753 (diff) | |
parent | fd85e9ef612a3f2ddd488024226d98378068f1fe (diff) |
Merge pull request #20336 from vespa-engine/mpolden/change-all-upstreams
Change routing status for all known clusters
Diffstat (limited to 'controller-api')
2 files changed, 27 insertions, 42 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/EndpointStatus.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/EndpointStatus.java index 2f1b93158ab..4b326bc7430 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/EndpointStatus.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/EndpointStatus.java @@ -1,59 +1,45 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.controller.api.application.v4.model; +import java.time.Instant; +import java.util.Objects; + /** - * Represent the operational status of a service endpoint (where the endpoint itself - * is identified by the container cluster id). - * - * The status of an endpoint may be assigned from the controller. + * Represent the routing status for all endpoints of a deployment. * * @author smorgrav */ public class EndpointStatus { + private final String agent; - private final String reason; private final Status status; - private final long epoch; + private final Instant changedAt; - public enum Status { - in, - out, - unknown; + public EndpointStatus(Status status, String agent, Instant changedAt) { + this.status = Objects.requireNonNull(status); + this.agent = Objects.requireNonNull(agent); + this.changedAt = Objects.requireNonNull(changedAt); } - public EndpointStatus(Status status, String reason, String agent, long epoch) { - this.status = status; - this.reason = reason; - this.agent = agent; - this.epoch = epoch; - } - - /** - * @return The agent responsible setting this status - */ - public String getAgent() { + /** Returns the agent responsible setting this status */ + public String agent() { return agent; } - /** - * @return The reason for this status (e.g. 'incident INCXXX') - */ - public String getReason() { - return reason; + /** Returns the current status */ + public Status status() { + return status; } - /** - * @return The current status - */ - public Status getStatus() { - return status; + /** Returns when this was last changed */ + public Instant changedAt() { + return changedAt; } - /** - * @return The epoch for when this status became active, in seconds - */ - public long getEpoch() { - return epoch; + public enum Status { + in, + out, + unknown; } } diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java index 122f836c908..7f9b693f413 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ConfigServer.java @@ -3,7 +3,6 @@ package com.yahoo.vespa.hosted.controller.api.integration.configserver; import com.yahoo.component.Version; import com.yahoo.config.provision.ApplicationId; -import com.yahoo.config.provision.TenantName; import com.yahoo.config.provision.zone.ZoneId; import com.yahoo.vespa.flags.json.FlagData; import com.yahoo.vespa.hosted.controller.api.application.v4.model.ClusterMetrics; @@ -85,12 +84,12 @@ public interface ConfigServer { /** * Set new status for a endpoint of a single deployment. * - * @param deployment The deployment to change - * @param upstreamName The upstream to modify. Upstream name is a unique identifier for the global route of a - * deployment in the shared routing layer - * @param status The new status + * @param deployment The deployment to change + * @param upstreamNames The upstream names to modify. Upstream name is a unique identifier for the routing status + * of a cluster in a deployment + * @param status The new status */ - void setGlobalRotationStatus(DeploymentId deployment, String upstreamName, EndpointStatus status); + void setGlobalRotationStatus(DeploymentId deployment, List<String> upstreamNames, EndpointStatus status); /** * Set the new status for an entire zone. |