summaryrefslogtreecommitdiffstats
path: root/orchestrator
diff options
context:
space:
mode:
authorJon Marius Venstad <jonmv@gmail.com>2022-04-07 16:29:59 +0200
committerJon Marius Venstad <jonmv@gmail.com>2022-04-07 16:29:59 +0200
commit75114c6c4b96f507071a2caf145b24a22ef0c5ff (patch)
treee4cca74c128bfdad380bc74a9f501d981b9c78ef /orchestrator
parent190dde5de267462b02c43a18ad605da469715949 (diff)
Use HttpURL for base url and query in StateRequestHandler
Diffstat (limited to 'orchestrator')
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HealthRequestHandler.java5
-rw-r--r--orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandler.java7
2 files changed, 7 insertions, 5 deletions
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HealthRequestHandler.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HealthRequestHandler.java
index 09311e6f3e0..f54b9e319d2 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HealthRequestHandler.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HealthRequestHandler.java
@@ -1,6 +1,7 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.orchestrator.resources;
+import ai.vespa.http.HttpURL.Path;
import com.google.inject.Inject;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.container.jdisc.ThreadedHttpRequestHandler;
@@ -51,8 +52,8 @@ public class HealthRequestHandler extends RestApiRequestHandler<HealthRequestHan
ApplicationReferenceList list = new ApplicationReferenceList();
list.applicationList = applications.stream().map(applicationId -> {
UrlReference reference = new UrlReference();
- reference.url = context.uriBuilder()
- .withPath("/orchestrator/v1/health/" + applicationId.serializedForm())
+ reference.url = context.baseRequestURL()
+ .withPath(Path.parse("/orchestrator/v1/health/" + applicationId.serializedForm()))
.toString();
return reference;
}).collect(Collectors.toList());
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandler.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandler.java
index f90258d97d7..8e292d1bd6e 100644
--- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandler.java
+++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/resources/HostRequestHandler.java
@@ -1,6 +1,7 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.vespa.orchestrator.resources;
+import ai.vespa.http.HttpURL.Path;
import com.google.inject.Inject;
import com.yahoo.concurrent.UncheckedTimeoutException;
import com.yahoo.container.jdisc.ThreadedHttpRequestHandler;
@@ -71,9 +72,9 @@ public class HostRequestHandler extends RestApiRequestHandler<HostRequestHandler
try {
Host host = orchestrator.getHost(hostName);
- URI applicationUri = context.uriBuilder()
- .withPath("/orchestrator/v1/instances/" + host.getApplicationInstanceReference().asString())
- .toURI();
+ URI applicationUri = context.baseRequestURL()
+ .withPath(Path.parse( "/orchestrator/v1/instances/" + host.getApplicationInstanceReference().asString()))
+ .asURI();
List<HostService> hostServices = host.getServiceInstances().stream()
.map(serviceInstance -> new HostService(