diff options
Diffstat (limited to 'controller-api')
2 files changed, 55 insertions, 0 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ArtifactRepository.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ArtifactRepository.java index 97f3acda67c..4a6cb10c5c2 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ArtifactRepository.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ArtifactRepository.java @@ -15,4 +15,7 @@ public interface ArtifactRepository { /** Returns the system application package of the given version. */ byte[] getSystemApplicationPackage(ApplicationId application, ZoneId zone, Version version); + /** Returns the current stable OS version for the given major version */ + StableOsVersion stableOsVersion(int major); + } diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/StableOsVersion.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/StableOsVersion.java new file mode 100644 index 00000000000..0eabb0b6b8a --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/StableOsVersion.java @@ -0,0 +1,52 @@ +// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.hosted.controller.api.integration.deployment; + +import com.yahoo.component.Version; + +import java.time.Instant; +import java.util.Objects; + +/** + * A stable OS version. + * + * @author mpolden + */ +public class StableOsVersion { + + private final Version version; + private final Instant promotedAt; + + public StableOsVersion(Version version, Instant promotedAt) { + this.version = Objects.requireNonNull(version); + this.promotedAt = Objects.requireNonNull(promotedAt); + } + + /** The version number */ + public Version version() { + return version; + } + + /** Returns the time this was promoted to stable */ + public Instant promotedAt() { + return promotedAt; + } + + @Override + public String toString() { + return "os version " + version + ", promoted at " + promotedAt; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + StableOsVersion that = (StableOsVersion) o; + return version.equals(that.version) && promotedAt.equals(that.promotedAt); + } + + @Override + public int hashCode() { + return Objects.hash(version, promotedAt); + } + +} |