[ONOS-3648] Rename CPMan REST API prefix

Existing REST API prefix is "cpman" which does not convey the
right meaning of the API.
This commit changes the prefix name from "cpman" to "collector"
to better convey the right meaning. This commit also splits the
REST URL with "_" to improve the URL readability.

Change-Id: I3152f7b784f2ae6cbaa8855dea8d5eaabd152487
diff --git a/apps/cpman/app/src/main/java/org/onosproject/cpman/rest/ControlMetricsCollectorWebResource.java b/apps/cpman/app/src/main/java/org/onosproject/cpman/rest/ControlMetricsCollectorWebResource.java
index 494b99f..ec04372 100644
--- a/apps/cpman/app/src/main/java/org/onosproject/cpman/rest/ControlMetricsCollectorWebResource.java
+++ b/apps/cpman/app/src/main/java/org/onosproject/cpman/rest/ControlMetricsCollectorWebResource.java
@@ -37,7 +37,7 @@
 /**
  * Collect control plane metrics.
  */
-@Path("cpman")
+@Path("collector")
 public class ControlMetricsCollectorWebResource extends AbstractWebResource {
 
     final ControlPlaneMonitorService service = get(ControlPlaneMonitorService.class);
@@ -52,7 +52,7 @@
      * @onos.rsModel CpuMetricsPost
      */
     @POST
-    @Path("cpumetrics")
+    @Path("cpu_metrics")
     @Consumes(MediaType.APPLICATION_JSON)
     @Produces(MediaType.APPLICATION_JSON)
     public Response cpuMetrics(InputStream stream) {
@@ -110,7 +110,7 @@
      * @onos.rsModel MemoryMetricsPost
      */
     @POST
-    @Path("memorymetrics")
+    @Path("memory_metrics")
     @Consumes(MediaType.APPLICATION_JSON)
     @Produces(MediaType.APPLICATION_JSON)
     public Response memoryMetrics(InputStream stream) {
@@ -161,7 +161,7 @@
      * @onos.rsModel DiskMetricsPost
      */
     @POST
-    @Path("diskmetrics")
+    @Path("disk_metrics")
     @Consumes(MediaType.APPLICATION_JSON)
     @Produces(MediaType.APPLICATION_JSON)
     public Response diskMetrics(InputStream stream) {
@@ -198,7 +198,7 @@
      * @onos.rsModel NetworkMetricsPost
      */
     @POST
-    @Path("networkmetrics")
+    @Path("network_metrics")
     @Consumes(MediaType.APPLICATION_JSON)
     @Produces(MediaType.APPLICATION_JSON)
     public Response networkMetrics(InputStream stream) {
@@ -252,7 +252,7 @@
      * @onos.rsModel SystemSpecsPost
      */
     @POST
-    @Path("systemspecs")
+    @Path("system_specs")
     @Consumes(MediaType.APPLICATION_JSON)
     @Produces(MediaType.APPLICATION_JSON)
     public Response systemSpecs(InputStream stream) {
diff --git a/apps/cpman/app/src/test/java/org/onosproject/cpman/rest/ControlMetricsCollectorResourceTest.java b/apps/cpman/app/src/test/java/org/onosproject/cpman/rest/ControlMetricsCollectorResourceTest.java
index e61873e..edfc6d6 100644
--- a/apps/cpman/app/src/test/java/org/onosproject/cpman/rest/ControlMetricsCollectorResourceTest.java
+++ b/apps/cpman/app/src/test/java/org/onosproject/cpman/rest/ControlMetricsCollectorResourceTest.java
@@ -52,6 +52,8 @@
     final ControlPlaneMonitorService mockControlPlaneMonitorService =
                                      createMock(ControlPlaneMonitorService.class);
 
+    private static final String PREFIX = "collector";
+
     /**
      * Sets up the global values for all the tests.
      */
@@ -69,7 +71,7 @@
                 (Optional<DeviceId>) anyObject());
         expectLastCall().times(5);
         replay(mockControlPlaneMonitorService);
-        basePostTest("cpu-metrics-post.json", "cpman/cpumetrics");
+        basePostTest("cpu-metrics-post.json", PREFIX + "/cpu_metrics");
     }
 
     @Test
@@ -78,7 +80,7 @@
                 (Optional<DeviceId>) anyObject());
         expectLastCall().times(4);
         replay(mockControlPlaneMonitorService);
-        basePostTest("memory-metrics-post.json", "cpman/memorymetrics");
+        basePostTest("memory-metrics-post.json", PREFIX + "/memory_metrics");
     }
 
     @Test
@@ -87,7 +89,7 @@
                 (Optional<DeviceId>) anyObject());
         expectLastCall().times(2);
         replay(mockControlPlaneMonitorService);
-        basePostTest("disk-metrics-post.json", "cpman/diskmetrics");
+        basePostTest("disk-metrics-post.json", PREFIX + "/disk_metrics");
     }
 
     @Test
@@ -96,12 +98,12 @@
                 (Optional<DeviceId>) anyObject());
         expectLastCall().times(4);
         replay(mockControlPlaneMonitorService);
-        basePostTest("network-metrics-post.json", "cpman/networkmetrics");
+        basePostTest("network-metrics-post.json", PREFIX + "/network_metrics");
     }
 
     @Test
     public void testSystemSpecsPost() {
-        basePostTest("system-spec-post.json", "cpman/systemspecs");
+        basePostTest("system-spec-post.json", PREFIX + "/system_specs");
     }
 
     private void basePostTest(String jsonFile, String path) {