Fixes for karaf 4.2.1 CLI annotations for cpman app
Change-Id: Id15516cfcff3a08045b4394e5d371fef15632032
diff --git a/apps/cpman/app/BUILD b/apps/cpman/app/BUILD
index 5ff2a6e..02d33cc 100644
--- a/apps/cpman/app/BUILD
+++ b/apps/cpman/app/BUILD
@@ -23,6 +23,7 @@
api_package = "org.onosproject.cpman.rest",
api_title = "Control Plane Manager API",
api_version = "1.0",
+ karaf_command_packages = ["org.onosproject.cpman.cli"],
test_deps = TEST_DEPS,
web_context = "/onos/cpman",
deps = COMPILE_DEPS,
diff --git a/apps/cpman/app/src/main/java/org/onosproject/cpman/cli/ControlMetricsStatsListCommand.java b/apps/cpman/app/src/main/java/org/onosproject/cpman/cli/ControlMetricsStatsListCommand.java
index 6ba7fb0..d545094 100644
--- a/apps/cpman/app/src/main/java/org/onosproject/cpman/cli/ControlMetricsStatsListCommand.java
+++ b/apps/cpman/app/src/main/java/org/onosproject/cpman/cli/ControlMetricsStatsListCommand.java
@@ -17,8 +17,10 @@
import org.apache.karaf.shell.api.action.Argument;
import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
import org.apache.karaf.shell.api.action.lifecycle.Service;
import org.onosproject.cli.AbstractShellCommand;
+import org.onosproject.cli.NodeIdCompleter;
import org.onosproject.cluster.NodeId;
import org.onosproject.cpman.ControlLoadSnapshot;
import org.onosproject.cpman.ControlMetricType;
@@ -48,15 +50,18 @@
@Argument(index = 0, name = "node", description = "ONOS node identifier",
required = true, multiValued = false)
+ @Completion(NodeIdCompleter.class)
String node = null;
@Argument(index = 1, name = "type",
description = "Resource type (cpu|memory|disk|network|control_message)",
required = true, multiValued = false)
+ @Completion(ControlResourceTypeCompleter.class)
String type = null;
@Argument(index = 2, name = "name", description = "Resource name (or Device Id)",
required = false, multiValued = false)
+ @Completion(ResourceNameCompleter.class)
String name = null;
@Override
diff --git a/apps/cpman/app/src/main/java/org/onosproject/cpman/cli/ControlResourceTypeCompleter.java b/apps/cpman/app/src/main/java/org/onosproject/cpman/cli/ControlResourceTypeCompleter.java
index 0236237..1118dc5 100644
--- a/apps/cpman/app/src/main/java/org/onosproject/cpman/cli/ControlResourceTypeCompleter.java
+++ b/apps/cpman/app/src/main/java/org/onosproject/cpman/cli/ControlResourceTypeCompleter.java
@@ -16,6 +16,7 @@
package org.onosproject.cpman.cli;
import com.google.common.collect.ImmutableList;
+import org.apache.karaf.shell.api.action.lifecycle.Service;
import org.onosproject.cli.AbstractChoicesCompleter;
import java.util.List;
@@ -26,6 +27,7 @@
/**
* Control resource type completer.
*/
+@Service
public class ControlResourceTypeCompleter extends AbstractChoicesCompleter {
private static final List<Type> RESOURCE_TYPES =