Clean up source code of REST API
- Add missing @Produces annotation
- Correct comments
- Restrict variable access level
Change-Id: I7f75650b83651248370e7781b1e8aec7eac2314c
diff --git a/web/api/src/main/java/org/onosproject/rest/resources/LinksWebResource.java b/web/api/src/main/java/org/onosproject/rest/resources/LinksWebResource.java
index 5fad392..5e107f4 100644
--- a/web/api/src/main/java/org/onosproject/rest/resources/LinksWebResource.java
+++ b/web/api/src/main/java/org/onosproject/rest/resources/LinksWebResource.java
@@ -24,7 +24,9 @@
import javax.ws.rs.GET;
import javax.ws.rs.Path;
+import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
+import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import static org.onosproject.net.DeviceId.deviceId;
@@ -37,15 +39,16 @@
public class LinksWebResource extends AbstractWebResource {
/**
- * Get infrastructure links.
+ * Gets infrastructure links.
* Returns array of all links, or links for the specified device or port.
* @onos.rsModel LinksGet
* @param deviceId (optional) device identifier
* @param port (optional) port number
* @param direction (optional) direction qualifier
- * @return 200 OK
+ * @return 200 OK with array of all links, or links for the specified device or port
*/
@GET
+ @Produces(MediaType.APPLICATION_JSON)
public Response getLinks(@QueryParam("device") String deviceId,
@QueryParam("port") String port,
@QueryParam("direction") String direction) {