From b1c4024eb738de96e6d227d2767297c6d75167f3 Mon Sep 17 00:00:00 2001 From: Harald Musum Date: Wed, 29 Sep 2021 12:51:05 +0200 Subject: Add method for getting application package from controller --- .../main/java/ai/vespa/hosted/api/ControllerHttpClient.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'hosted-api/src/main') diff --git a/hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java b/hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java index 000b6cd4149..614f2fe6732 100644 --- a/hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java +++ b/hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java @@ -168,6 +168,13 @@ public abstract class ControllerHttpClient { GET))); } + /** Returns the application package of the given id. */ + public HttpResponse applicationPackage(ApplicationId id) { + return send(request(HttpRequest.newBuilder(applicationPackagePath(id)) + .timeout(Duration.ofMinutes(2)), + GET)); + } + /** Follows the given deployment job until it is done, or this thread is interrupted, at which point the current status is returned. */ public DeploymentLog followDeploymentUntilDone(ApplicationId id, ZoneId zone, long run, Consumer out) { @@ -265,6 +272,10 @@ public abstract class ControllerHttpClient { "after", Long.toString(after)); } + private URI applicationPackagePath(ApplicationId id) { + return concatenated(applicationPath(id.tenant(), id.application()), "package"); + } + private URI defaultRegionPath(Environment environment) { return concatenated(endpoint, "zone", "v1", "environment", environment.value(), "default"); } -- cgit v1.2.3