summaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2020-01-14 17:00:21 +0100
committerJon Marius Venstad <venstad@gmail.com>2020-01-14 17:00:21 +0100
commit8f7ce3d0bcbd837887a4b8f52d1793ebbfc4cb63 (patch)
tree3e66a481ed610dc981a82a2cf99692644d486e00 /controller-server
parent46ba71c23d5a11a0307e82bbb470f7fde7a78214 (diff)
Deployment glance-value info in list in instance
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java15
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/instance-with-routing-policy.json12
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/instance-without-change-multiple-deployments.json24
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/instance.json12
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/prod-us-central-1.json12
5 files changed, 74 insertions, 1 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
index b8e10b737e3..6017a85a6f9 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/application/ApplicationApiHandler.java
@@ -51,6 +51,7 @@ import com.yahoo.vespa.hosted.controller.api.integration.configserver.ConfigServ
import com.yahoo.vespa.hosted.controller.api.integration.configserver.Log;
import com.yahoo.vespa.hosted.controller.api.integration.configserver.Node;
import com.yahoo.vespa.hosted.controller.api.integration.deployment.ApplicationVersion;
+import com.yahoo.vespa.hosted.controller.api.integration.deployment.JobId;
import com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType;
import com.yahoo.vespa.hosted.controller.api.integration.deployment.RunId;
import com.yahoo.vespa.hosted.controller.api.integration.deployment.SourceRevision;
@@ -955,7 +956,19 @@ public class ApplicationApiHandler extends LoggingRequestHandler {
toSlime(instance.rotations(), instance.rotationStatus(), deployment, deploymentObject);
}
-
+ JobType.from(controller.system(), deployment.zone())
+ .map(type -> new JobId(instance.id(), type))
+ .map(status.jobSteps()::get)
+ .ifPresent(stepStatus -> {
+ deploymentObject.setString("platform", deployment.version().toFullString());
+ toSlime(deployment.applicationVersion(), deploymentObject.setObject("applicationVersion"));
+ if ( ! status.jobsToRun().containsKey(stepStatus.job().get()))
+ deploymentObject.setString("status", "complete");
+ else if (stepStatus.readyAt(instance.change()).map(controller.clock().instant()::isBefore).orElse(false))
+ deploymentObject.setString("status", "pending");
+ else deploymentObject.setString("status", "running");
+
+ });
}
if (recurseOverDeployments(request)) // List full deployment information when recursive.
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/instance-with-routing-policy.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/instance-with-routing-policy.json
index 18f5127718f..4e03364d896 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/instance-with-routing-policy.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/instance-with-routing-policy.json
@@ -185,6 +185,18 @@
],
"instances": [
{
+ "platform": "6.1.0",
+ "applicationVersion": {
+ "buildNumber": 1,
+ "hash": "1.0.1-commit1", "source": {
+ "gitRepository": "repository1",
+ "gitBranch": "master",
+ "gitCommit": "commit1"
+ },
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
+ },
+ "status": "complete",
"environment": "prod",
"region": "us-west-1",
"instance": "instance1",
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/instance-without-change-multiple-deployments.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/instance-without-change-multiple-deployments.json
index 259fe814146..30002d09bf6 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/instance-without-change-multiple-deployments.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/instance-without-change-multiple-deployments.json
@@ -253,6 +253,18 @@
"lastUpdated": "(ignore)"
}
],
+ "platform": "6.1.0",
+ "applicationVersion": {
+ "buildNumber": 1,
+ "hash": "1.0.1-commit1", "source": {
+ "gitRepository": "repository1",
+ "gitBranch": "master",
+ "gitCommit": "commit1"
+ },
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
+ },
+ "status": "complete",
"environment": "prod",
"region": "us-west-1",
"instance": "instance1",
@@ -271,6 +283,18 @@
"lastUpdated": "(ignore)"
}
],
+ "platform": "6.1.0",
+ "applicationVersion": {
+ "buildNumber": 1,
+ "hash": "1.0.1-commit1", "source": {
+ "gitRepository": "repository1",
+ "gitBranch": "master",
+ "gitCommit": "commit1"
+ },
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
+ },
+ "status": "complete",
"environment": "prod",
"region": "us-east-3",
"instance": "instance1",
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/instance.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/instance.json
index fd8bc256ac5..d6371ea05b6 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/instance.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/instance.json
@@ -266,6 +266,18 @@
"lastUpdated":"(ignore)"
}
],
+ "platform": "6.1.0",
+ "applicationVersion": {
+ "buildNumber": 1,
+ "hash": "1.0.1-commit1", "source": {
+ "gitRepository": "repository1",
+ "gitBranch": "master",
+ "gitCommit": "commit1"
+ },
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
+ },
+ "status": "complete",
"environment": "prod",
"region": "us-central-1",
"instance": "instance1",
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/prod-us-central-1.json b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/prod-us-central-1.json
index a9d85dda0a9..aa461c04910 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/prod-us-central-1.json
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/application/responses/prod-us-central-1.json
@@ -11,6 +11,18 @@
"lastUpdated": "(ignore)"
}
],
+ "platform": "6.1.0",
+ "applicationVersion": {
+ "buildNumber": 1,
+ "hash": "1.0.1-commit1", "source": {
+ "gitRepository": "repository1",
+ "gitBranch": "master",
+ "gitCommit": "commit1"
+ },
+ "sourceUrl": "repository1/tree/commit1",
+ "commit": "commit1"
+ },
+ "status": "complete",
"tenant": "tenant1",
"application": "application1",
"instance": "instance1",