aboutsummaryrefslogtreecommitdiffstats
path: root/controller-server
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2018-10-25 08:59:28 +0200
committerMartin Polden <mpolden@mpolden.no>2018-10-25 08:59:28 +0200
commit03bc9bf046d17fa102874fe76935c633ab84a4b5 (patch)
tree4e65067c5592acfb5ebdd0cccd08cf4e96df3ac0 /controller-server
parent4fee3c3009cdfa4af69e2e4ca9d414a6fca47f8f (diff)
Remove unused API path
Diffstat (limited to 'controller-server')
-rw-r--r--controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/screwdriver/ScrewdriverApiHandler.java22
-rw-r--r--controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/screwdriver/ScrewdriverApiTest.java14
2 files changed, 3 insertions, 33 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/screwdriver/ScrewdriverApiHandler.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/screwdriver/ScrewdriverApiHandler.java
index 74caa4dcb47..6633eafc509 100644
--- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/screwdriver/ScrewdriverApiHandler.java
+++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/screwdriver/ScrewdriverApiHandler.java
@@ -6,15 +6,14 @@ import com.yahoo.container.jdisc.HttpRequest;
import com.yahoo.container.jdisc.HttpResponse;
import com.yahoo.container.jdisc.LoggingRequestHandler;
import com.yahoo.jdisc.http.HttpRequest.Method;
+import com.yahoo.restapi.Path;
import com.yahoo.slime.Cursor;
import com.yahoo.slime.Slime;
import com.yahoo.vespa.hosted.controller.Controller;
import com.yahoo.vespa.hosted.controller.api.integration.BuildService;
import com.yahoo.vespa.hosted.controller.api.integration.deployment.JobType;
import com.yahoo.vespa.hosted.controller.restapi.ErrorResponse;
-import com.yahoo.restapi.Path;
import com.yahoo.vespa.hosted.controller.restapi.SlimeJsonResponse;
-import com.yahoo.vespa.hosted.controller.versions.VespaVersion;
import com.yahoo.yolean.Exceptions;
import java.io.InputStream;
@@ -64,11 +63,9 @@ public class ScrewdriverApiHandler extends LoggingRequestHandler {
private HttpResponse get(HttpRequest request) {
Path path = new Path(request.getUri().getPath());
- if (path.matches("/screwdriver/v1/release/vespa")) {
- return vespaVersion();
- }
- if (path.matches("/screwdriver/v1/jobsToRun"))
+ if (path.matches("/screwdriver/v1/jobsToRun")) {
return buildJobs(controller.applications().deploymentTrigger().jobsToRun());
+ }
return notFound(request);
}
@@ -97,19 +94,6 @@ public class ScrewdriverApiHandler extends LoggingRequestHandler {
return new SlimeJsonResponse(slime);
}
- private HttpResponse vespaVersion() {
- VespaVersion version = controller.versionStatus().version(controller.systemVersion());
- if (version == null)
- return ErrorResponse.notFoundError("Information about the current system version is not available at this time");
-
- Slime slime = new Slime();
- Cursor cursor = slime.setObject();
- cursor.setString("version", version.versionNumber().toString());
- cursor.setString("sha", version.releaseCommit());
- cursor.setLong("date", version.committedAt().toEpochMilli());
- return new SlimeJsonResponse(slime);
- }
-
private HttpResponse buildJobs(Map<JobType, ? extends List<? extends BuildService.BuildJob>> jobLists) {
Slime slime = new Slime();
Cursor jobTypesObject = slime.setObject();
diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/screwdriver/ScrewdriverApiTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/screwdriver/ScrewdriverApiTest.java
index 6cd4464dce4..6391e49d041 100644
--- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/screwdriver/ScrewdriverApiTest.java
+++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/screwdriver/ScrewdriverApiTest.java
@@ -8,10 +8,8 @@ import com.yahoo.vespa.hosted.controller.application.DeploymentJobs.JobReport;
import com.yahoo.vespa.hosted.controller.application.SourceRevision;
import com.yahoo.vespa.hosted.controller.restapi.ContainerControllerTester;
import com.yahoo.vespa.hosted.controller.restapi.ControllerContainerTest;
-import com.yahoo.vespa.hosted.controller.versions.VersionStatus;
import org.junit.Test;
-import java.io.File;
import java.nio.charset.StandardCharsets;
import java.util.Optional;
import java.util.OptionalLong;
@@ -25,18 +23,6 @@ public class ScrewdriverApiTest extends ControllerContainerTest {
private static final String responseFiles = "src/test/java/com/yahoo/vespa/hosted/controller/restapi/screwdriver/responses/";
@Test
- public void testGetReleaseStatus() throws Exception {
- ContainerControllerTester tester = new ContainerControllerTester(container, responseFiles);
- tester.containerTester().assertResponse(authenticatedRequest("http://localhost:8080/screwdriver/v1/release/vespa"),
- "{\"error-code\":\"NOT_FOUND\",\"message\":\"Information about the current system version is not available at this time\"}",
- 404);
-
- tester.controller().updateVersionStatus(VersionStatus.compute(tester.controller()));
- tester.containerTester().assertResponse(authenticatedRequest("http://localhost:8080/screwdriver/v1/release/vespa"),
- new File("release-response.json"), 200);
- }
-
- @Test
public void testTriggerJobForApplication() {
ContainerControllerTester tester = new ContainerControllerTester(container, responseFiles);
tester.containerTester().computeVersionStatus();