summaryrefslogtreecommitdiffstats
path: root/hosted-api
diff options
context:
space:
mode:
authorJon Marius Venstad <jvenstad@yahoo-inc.com>2019-05-07 15:31:03 +0200
committerJon Marius Venstad <jvenstad@yahoo-inc.com>2019-05-07 15:34:26 +0200
commitee303bda28ac0f7df6170b1a11b7d62ab1a2f8e9 (patch)
treec8692e733e119a3848ca2035668b09f3057bc20e /hosted-api
parente7ac6e07b25e1e20e7a56edaaff3a08f69ab0e0f (diff)
Add CompileVersion mojo
Diffstat (limited to 'hosted-api')
-rw-r--r--hosted-api/src/main/java/ai/vespa/hosted/api/ControllerHttpClient.java13
1 files changed, 11 insertions, 2 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 f561e2766c7..ca812f92c49 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
@@ -82,6 +82,7 @@ public abstract class ControllerHttpClient {
toDataStream(deployment))));
}
+ /** Deactivates the deployment of the given application in the given zone. */
public String deactivate(ApplicationId id, ZoneId zone) {
return asText(send(request(HttpRequest.newBuilder(deploymentPath(id, zone))
.timeout(Duration.ofSeconds(10)),
@@ -91,11 +92,19 @@ public abstract class ControllerHttpClient {
/** Returns the default {@link Environment#dev} {@link ZoneId}, to use for development deployments. */
public ZoneId devZone() {
Inspector rootObject = toInspector(send(request(HttpRequest.newBuilder(defaultRegionPath())
- .timeout(Duration.ofSeconds(10)),
- GET)));
+ .timeout(Duration.ofSeconds(10)),
+ GET)));
return ZoneId.from("dev", rootObject.field("name").asString());
}
+ /** Returns the Vespa version to compile against, for a hosted Vespa application. This is its lowest runtime version. */
+ public String compileVersion(ApplicationId id) {
+ return toInspector(send(request(HttpRequest.newBuilder(applicationPath(id.tenant(), id.application()))
+ .timeout(Duration.ofSeconds(10)),
+ GET)))
+ .field("compileVersion").asString();
+ }
+
protected HttpRequest request(HttpRequest.Builder request, Method method, Supplier<InputStream> data) {
return request.method(method.name(), ofInputStream(data)).build();
}