aboutsummaryrefslogtreecommitdiffstats
path: root/configserver
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2022-03-30 15:52:09 +0200
committerJon Marius Venstad <venstad@gmail.com>2022-03-30 15:52:09 +0200
commit51368648e157524420ece2e1754acbe93e0c1eaf (patch)
tree99d61228b06ff81c2f9bc9260eb8c178e5116c82 /configserver
parent43567e1f53e756772316ea7f0850fdc1602f2f73 (diff)
Split in DomainName and Hostname
Diffstat (limited to 'configserver')
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java6
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandler.java4
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/ApplicationRepositoryTest.java4
3 files changed, 7 insertions, 7 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java b/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java
index 4728b80af1f..0828c53a499 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java
@@ -1,7 +1,7 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.server;
-import ai.vespa.validation.Hostname;
+import ai.vespa.validation.DomainName;
import com.google.inject.Inject;
import com.yahoo.cloud.config.ConfigserverConfig;
import com.yahoo.component.Version;
@@ -762,7 +762,7 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye
// ---------------- Logs ----------------------------------------------------------------
- public HttpResponse getLogs(ApplicationId applicationId, Optional<Hostname> hostname, String apiParams) {
+ public HttpResponse getLogs(ApplicationId applicationId, Optional<DomainName> hostname, String apiParams) {
String logServerURI = getLogServerURI(applicationId, hostname) + apiParams;
return logRetriever.getLogs(logServerURI);
}
@@ -1129,7 +1129,7 @@ public class ApplicationRepository implements com.yahoo.config.provision.Deploye
}
}
- private String getLogServerURI(ApplicationId applicationId, Optional<Hostname> hostname) {
+ private String getLogServerURI(ApplicationId applicationId, Optional<DomainName> hostname) {
// Allow to get logs from a given hostname if the application is under the hosted-vespa tenant.
// We make no validation that the hostname is actually allocated to the given application since
// most applications under hosted-vespa are not known to the model and it's OK for a user to get
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandler.java b/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandler.java
index 49c056e7f80..79435dc61ae 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandler.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandler.java
@@ -1,7 +1,7 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.server.http.v2;
-import ai.vespa.validation.Hostname;
+import ai.vespa.validation.DomainName;
import com.google.inject.Inject;
import com.yahoo.component.Version;
import com.yahoo.config.application.api.ApplicationFile;
@@ -157,7 +157,7 @@ public class ApplicationHandler extends HttpHandler {
}
private HttpResponse logs(ApplicationId applicationId, HttpRequest request) {
- Optional<Hostname> hostname = Optional.ofNullable(request.getProperty("hostname")).map(Hostname::of);
+ Optional<DomainName> hostname = Optional.ofNullable(request.getProperty("hostname")).map(DomainName::of);
String apiParams = Optional.ofNullable(request.getUri().getQuery()).map(q -> "?" + q).orElse("");
return applicationRepository.getLogs(applicationId, hostname, apiParams);
}
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/ApplicationRepositoryTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/ApplicationRepositoryTest.java
index 2586911891f..13571f218ca 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/ApplicationRepositoryTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/ApplicationRepositoryTest.java
@@ -1,7 +1,7 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.config.server;
-import ai.vespa.validation.Hostname;
+import ai.vespa.validation.DomainName;
import com.yahoo.cloud.config.ConfigserverConfig;
import com.yahoo.component.Version;
import com.yahoo.config.ConfigInstance;
@@ -254,7 +254,7 @@ public class ApplicationRepositoryTest {
public void getLogsForHostname() {
ApplicationId applicationId = ApplicationId.from("hosted-vespa", "tenant-host", "default");
deployApp(testAppLogServerWithContainer, new PrepareParams.Builder().applicationId(applicationId).build());
- HttpResponse response = applicationRepository.getLogs(applicationId, Optional.of(Hostname.localhost), "");
+ HttpResponse response = applicationRepository.getLogs(applicationId, Optional.of(DomainName.localhost), "");
assertEquals(200, response.getStatus());
}