summaryrefslogtreecommitdiffstats
path: root/configserver
diff options
context:
space:
mode:
authorValerij Fredriksen <valerij92@gmail.com>2021-07-06 10:15:16 +0200
committerValerij Fredriksen <valerij92@gmail.com>2021-07-06 10:26:18 +0200
commiteb4d2e8229936cad8d4dbf5a601001298fede5d7 (patch)
tree1a19907bd59f63147462c76cfbdfd338e23e5b71 /configserver
parent85fecfc6ee020f05b5b77141a120dfc5179434a9 (diff)
Use MessageResponse for delete application
Diffstat (limited to 'configserver')
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandler.java3
-rw-r--r--configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/DeleteApplicationResponse.java9
2 files changed, 5 insertions, 7 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandler.java b/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandler.java
index ba70c34d192..7478efdd0c8 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandler.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/ApplicationHandler.java
@@ -16,7 +16,6 @@ import com.yahoo.io.IOUtils;
import com.yahoo.jdisc.Response;
import com.yahoo.jdisc.application.BindingMatch;
import com.yahoo.jdisc.application.UriPattern;
-import com.yahoo.slime.Cursor;
import com.yahoo.slime.SlimeUtils;
import com.yahoo.text.StringUtilities;
import com.yahoo.vespa.config.server.ApplicationRepository;
@@ -97,7 +96,7 @@ public class ApplicationHandler extends HttpHandler {
}
if (applicationRepository.delete(applicationId))
- return new DeleteApplicationResponse(Response.Status.OK, applicationId);
+ return new DeleteApplicationResponse(applicationId);
return HttpErrorResponse.notFoundError("Unable to delete " + applicationId.toFullString() + ": Not found");
}
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/DeleteApplicationResponse.java b/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/DeleteApplicationResponse.java
index 2a0f785c60a..add0c7a45f3 100644
--- a/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/DeleteApplicationResponse.java
+++ b/configserver/src/main/java/com/yahoo/vespa/config/server/http/v2/DeleteApplicationResponse.java
@@ -1,11 +1,10 @@
package com.yahoo.vespa.config.server.http.v2;
import com.yahoo.config.provision.ApplicationId;
-import com.yahoo.vespa.config.server.http.JSONResponse;
+import com.yahoo.restapi.MessageResponse;
-class DeleteApplicationResponse extends JSONResponse {
- DeleteApplicationResponse(int status, ApplicationId applicationId) {
- super(status);
- object.setString("message", "Application '" + applicationId + "' deleted");
+public class DeleteApplicationResponse extends MessageResponse {
+ public DeleteApplicationResponse(ApplicationId applicationId) {
+ super("Application '" + applicationId + "' deleted");
}
}