summaryrefslogtreecommitdiffstats
path: root/hosted-api
diff options
context:
space:
mode:
authorHarald Musum <musum@yahooinc.com>2021-09-29 12:51:05 +0200
committerHarald Musum <musum@yahooinc.com>2021-09-29 12:51:05 +0200
commitb1c4024eb738de96e6d227d2767297c6d75167f3 (patch)
tree6c2f65567af4a3784e2a65cdc65482b1c694d537 /hosted-api
parent203ec4b47528c648d287af24636ea60f323c9ae9 (diff)
Add method for getting application package from controller
Diffstat (limited to 'hosted-api')
-rw-r--r--hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java11
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");
}