Fixes for karaf 4.2.1 CLI annotations for dhcp app
Change-Id: I92946b88c2ed156cd310c8323a9b62b6554f4cc4
diff --git a/apps/dhcp/app/BUILD b/apps/dhcp/app/BUILD
index a19dd53..5d9634c 100644
--- a/apps/dhcp/app/BUILD
+++ b/apps/dhcp/app/BUILD
@@ -8,6 +8,7 @@
api_package = "org.onosproject.dhcp.rest",
api_title = "DHCP Server",
api_version = "1.0",
+ karaf_command_packages = ["org.onosproject.dhcp.cli"],
test_deps = TEST_ADAPTERS,
web_context = "/onos/dhcp",
deps = COMPILE_DEPS,
diff --git a/apps/dhcp/app/src/main/java/org/onosproject/dhcp/cli/DhcpRemoveStaticMapping.java b/apps/dhcp/app/src/main/java/org/onosproject/dhcp/cli/DhcpRemoveStaticMapping.java
index 3d0e3fc..a6989d2 100644
--- a/apps/dhcp/app/src/main/java/org/onosproject/dhcp/cli/DhcpRemoveStaticMapping.java
+++ b/apps/dhcp/app/src/main/java/org/onosproject/dhcp/cli/DhcpRemoveStaticMapping.java
@@ -17,6 +17,7 @@
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.onlab.packet.MacAddress;
import org.onosproject.cli.AbstractShellCommand;
@@ -33,6 +34,7 @@
@Argument(index = 0, name = "macAddr",
description = "MAC Address of the client",
required = true, multiValued = false)
+ @Completion(MacIdCompleter.class)
String macAddr = null;
private static final String DHCP_SUCCESS = "Static Mapping Successfully Removed.";
diff --git a/apps/dhcp/app/src/main/java/org/onosproject/dhcp/cli/DhcpSetStaticMapping.java b/apps/dhcp/app/src/main/java/org/onosproject/dhcp/cli/DhcpSetStaticMapping.java
index 2c8ce13..ee59b30 100644
--- a/apps/dhcp/app/src/main/java/org/onosproject/dhcp/cli/DhcpSetStaticMapping.java
+++ b/apps/dhcp/app/src/main/java/org/onosproject/dhcp/cli/DhcpSetStaticMapping.java
@@ -17,6 +17,7 @@
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.onlab.packet.Ip4Address;
import org.onlab.packet.MacAddress;
@@ -39,11 +40,13 @@
@Argument(index = 0, name = "macAddr",
description = "MAC Address of the client",
required = true, multiValued = false)
+ @Completion(MacIdCompleter.class)
String macAddr = null;
@Argument(index = 1, name = "ipAddr",
description = "IP Address requested for static mapping",
required = true, multiValued = false)
+ @Completion(FreeIpCompleter.class)
String ipAddr = null;
private static final String DHCP_SUCCESS = "Static Mapping Successfully Added.";