Explicitly return NO CONTENT type response for http DELETE request
Change-Id: I920084b92197bb1687e7d978ad350b2e1290ecbc
diff --git a/src/main/java/org/onosproject/segmentrouting/web/PolicyWebResource.java b/src/main/java/org/onosproject/segmentrouting/web/PolicyWebResource.java
index 45af70e..9a19c37 100644
--- a/src/main/java/org/onosproject/segmentrouting/web/PolicyWebResource.java
+++ b/src/main/java/org/onosproject/segmentrouting/web/PolicyWebResource.java
@@ -64,7 +64,6 @@
*
* @param input JSON stream for policy to create
* @return status of the request - OK if the policy is created,
- * INTERNAL_SERVER_ERROR if the JSON is invalid or the policy cannot be created
* @throws IOException if JSON processing fails
*/
@POST
@@ -87,8 +86,7 @@
* Delete a segment routing policy.
*
* @param input JSON stream for policy to delete
- * @return status of the request - OK if the policy is removed,
- * INTERNAL_SERVER_ERROR otherwise
+ * @return 204 NO CONTENT if the policy is removed
* @throws IOException if JSON is invalid
*/
@DELETE
@@ -101,8 +99,7 @@
// TODO: Check the result
srService.removePolicy(policyInfo);
- return Response.ok().build();
-
+ return Response.noContent().build();
}
}
diff --git a/src/main/java/org/onosproject/segmentrouting/web/TunnelWebResource.java b/src/main/java/org/onosproject/segmentrouting/web/TunnelWebResource.java
index 217a6b9..94fcd69 100644
--- a/src/main/java/org/onosproject/segmentrouting/web/TunnelWebResource.java
+++ b/src/main/java/org/onosproject/segmentrouting/web/TunnelWebResource.java
@@ -64,7 +64,6 @@
*
* @param input JSON stream for tunnel to create
* @return status of the request - OK if the tunnel is created,
- * INTERNAL_SERVER_ERROR if the JSON is invalid or the tunnel cannot be created
* @throws IOException if the JSON is invalid
*/
@POST
@@ -83,8 +82,7 @@
* Delete a segment routing tunnel.
*
* @param input JSON stream for tunnel to delete
- * @return status of the request - OK if the tunnel is removed,
- * INTERNAL_SERVER_ERROR otherwise
+ * @return 204 NO CONTENT, if the tunnel is removed
* @throws IOException if JSON is invalid
*/
@DELETE
@@ -96,7 +94,7 @@
Tunnel tunnelInfo = TUNNEL_CODEC.decode(tunnelJson, this);
srService.removeTunnel(tunnelInfo);
- return Response.ok().build();
+ return Response.noContent().build();
}
}