Add method for getting application package from controller
@@ -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");
}
