diff options
author | Martin Polden <mpolden@mpolden.no> | 2019-06-14 10:35:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-14 10:35:13 +0200 |
commit | bfe6480219413ccd77632126da4e02c42a5097c7 (patch) | |
tree | f81dc264ab8f88fc8da9f375f7a2498410552bc0 /controller-api | |
parent | 7ec119b4e435e4612d4d8293f7abfcd3e779a484 (diff) | |
parent | 33c29c4faea7762e53cb5a6491ae446944c08e2a (diff) |
Merge pull request #9780 from vespa-engine/mpolden/wire-container-endpoints
Add support for containerEndpoints deploy parameter
Diffstat (limited to 'controller-api')
2 files changed, 61 insertions, 1 deletions
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 68711e25958..56d05f3ce9d 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 @@ -31,7 +31,8 @@ public interface ConfigServer { PrepareResponse prepareResponse(); } - PreparedApplication deploy(DeploymentId deployment, DeployOptions deployOptions, Set<String> rotationNames, byte[] content); + PreparedApplication deploy(DeploymentId deployment, DeployOptions deployOptions, Set<String> rotationNames, + List<ContainerEndpoint> containerEndpoints, byte[] content); void restart(DeploymentId deployment, Optional<Hostname> hostname); diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ContainerEndpoint.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ContainerEndpoint.java new file mode 100644 index 00000000000..2134320bdc1 --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/configserver/ContainerEndpoint.java @@ -0,0 +1,59 @@ +// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.hosted.controller.api.integration.configserver; + +import java.util.List; +import java.util.Objects; + +/** + * This represents a list of one or more names for a container cluster. + * + * @author mpolden + */ +public class ContainerEndpoint { + + private final String clusterId; + private final List<String> names; + + public ContainerEndpoint(String clusterId, List<String> names) { + this.clusterId = nonEmpty(clusterId, "message must be non-empty"); + this.names = List.copyOf(Objects.requireNonNull(names, "names must be non-null")); + } + + /** ID of the cluster to which this points */ + public String clusterId() { + return clusterId; + } + + /** + * All valid DNS names for this endpoint. This can contain both proper DNS names and synthetic identifiers used for + * routing, such as a Host header value that is not necessarily a proper DNS name. + */ + public List<String> names() { + return names; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + ContainerEndpoint that = (ContainerEndpoint) o; + return clusterId.equals(that.clusterId) && + names.equals(that.names); + } + + @Override + public int hashCode() { + return Objects.hash(clusterId, names); + } + + @Override + public String toString() { + return "container endpoint for " + clusterId + " " + names; + } + + private static String nonEmpty(String s, String message) { + if (s == null || s.isBlank()) throw new IllegalArgumentException(message); + return s; + } + +} |