diff options
Diffstat (limited to 'hosted-api/src/main')
-rw-r--r-- | hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java | 11 |
1 files changed, 11 insertions, 0 deletions
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<byte[]> 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<DeploymentLog.Entry> 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"); } |