Fixes for karaf 4.2.1 CLI annotations for segment routing app
Change-Id: Id3722bf49c37fe480ab8973c228987cc526804b3
diff --git a/app/BUILD b/app/BUILD
index 9edce3e..f5bb7ec 100644
--- a/app/BUILD
+++ b/app/BUILD
@@ -14,6 +14,7 @@
]
osgi_jar_with_tests(
+ karaf_command_packages = ["org.onosproject.segmentrouting.cli"],
test_deps = TEST_DEPS,
deps = COMPILE_DEPS,
)
diff --git a/app/src/main/java/org/onosproject/segmentrouting/cli/McastLeaderListCommand.java b/app/src/main/java/org/onosproject/segmentrouting/cli/McastLeaderListCommand.java
index 337a65d..633745c 100644
--- a/app/src/main/java/org/onosproject/segmentrouting/cli/McastLeaderListCommand.java
+++ b/app/src/main/java/org/onosproject/segmentrouting/cli/McastLeaderListCommand.java
@@ -17,6 +17,7 @@
package org.onosproject.segmentrouting.cli;
import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
import org.apache.karaf.shell.api.action.Option;
import org.apache.karaf.shell.api.action.lifecycle.Service;
import org.onlab.packet.IpAddress;
@@ -47,6 +48,7 @@
description = "IP Address of the multicast group",
valueToShowInHelp = "224.0.0.0",
required = false, multiValued = false)
+ @Completion(McastGroupCompleter.class)
String gAddr = null;
@Override
diff --git a/app/src/main/java/org/onosproject/segmentrouting/cli/McastNextListCommand.java b/app/src/main/java/org/onosproject/segmentrouting/cli/McastNextListCommand.java
index aad9a7e..7dd6fd3 100644
--- a/app/src/main/java/org/onosproject/segmentrouting/cli/McastNextListCommand.java
+++ b/app/src/main/java/org/onosproject/segmentrouting/cli/McastNextListCommand.java
@@ -18,6 +18,7 @@
import com.google.common.collect.Maps;
import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
import org.apache.karaf.shell.api.action.Option;
import org.apache.karaf.shell.api.action.lifecycle.Service;
import org.onlab.packet.IpAddress;
@@ -53,6 +54,7 @@
description = "IP Address of the multicast group",
valueToShowInHelp = "224.0.0.0",
required = false, multiValued = false)
+ @Completion(McastGroupCompleter.class)
String gAddr = null;
@Override
diff --git a/app/src/main/java/org/onosproject/segmentrouting/cli/McastRoleListCommand.java b/app/src/main/java/org/onosproject/segmentrouting/cli/McastRoleListCommand.java
index a00663b..2b22c67 100644
--- a/app/src/main/java/org/onosproject/segmentrouting/cli/McastRoleListCommand.java
+++ b/app/src/main/java/org/onosproject/segmentrouting/cli/McastRoleListCommand.java
@@ -20,10 +20,12 @@
import com.google.common.collect.Maps;
import com.google.common.collect.Multimap;
import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
import org.apache.karaf.shell.api.action.Option;
import org.apache.karaf.shell.api.action.lifecycle.Service;
import org.onlab.packet.IpAddress;
import org.onosproject.cli.AbstractShellCommand;
+import org.onosproject.cli.net.ConnectPointCompleter;
import org.onosproject.mcast.cli.McastGroupCompleter;
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.DeviceId;
@@ -56,12 +58,14 @@
description = "IP Address of the multicast group",
valueToShowInHelp = "224.0.0.0",
required = false, multiValued = false)
+ @Completion(McastGroupCompleter.class)
String gAddr = null;
@Option(name = "-src", aliases = "--connectPoint",
description = "Source port of:XXXXXXXXXX/XX",
valueToShowInHelp = "of:0000000000000001/1",
required = false, multiValued = false)
+ @Completion(ConnectPointCompleter.class)
String source = null;
@Override
diff --git a/app/src/main/java/org/onosproject/segmentrouting/cli/McastTreeListCommand.java b/app/src/main/java/org/onosproject/segmentrouting/cli/McastTreeListCommand.java
index 2d08196..09c795c 100644
--- a/app/src/main/java/org/onosproject/segmentrouting/cli/McastTreeListCommand.java
+++ b/app/src/main/java/org/onosproject/segmentrouting/cli/McastTreeListCommand.java
@@ -22,10 +22,12 @@
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Multimap;
import org.apache.karaf.shell.api.action.Command;
+import org.apache.karaf.shell.api.action.Completion;
import org.apache.karaf.shell.api.action.Option;
import org.apache.karaf.shell.api.action.lifecycle.Service;
import org.onlab.packet.IpAddress;
import org.onosproject.cli.AbstractShellCommand;
+import org.onosproject.cli.net.ConnectPointCompleter;
import org.onosproject.mcast.cli.McastGroupCompleter;
import org.onosproject.net.ConnectPoint;
import org.onosproject.segmentrouting.SegmentRoutingService;
@@ -56,12 +58,14 @@
description = "IP Address of the multicast group",
valueToShowInHelp = "224.0.0.0",
required = false, multiValued = false)
+ @Completion(McastGroupCompleter.class)
String gAddr = null;
@Option(name = "-src", aliases = "--connectPoint",
description = "Source port of:XXXXXXXXXX/XX",
valueToShowInHelp = "of:0000000000000001/1",
required = false, multiValued = false)
+ @Completion(ConnectPointCompleter.class)
String source = null;
@Override
diff --git a/app/src/main/java/org/onosproject/segmentrouting/cli/PseudowireRemoveCommand.java b/app/src/main/java/org/onosproject/segmentrouting/cli/PseudowireRemoveCommand.java
index fb1705c..2bb28b0 100644
--- a/app/src/main/java/org/onosproject/segmentrouting/cli/PseudowireRemoveCommand.java
+++ b/app/src/main/java/org/onosproject/segmentrouting/cli/PseudowireRemoveCommand.java
@@ -18,6 +18,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.onosproject.cli.AbstractShellCommand;
import org.onosproject.segmentrouting.SegmentRoutingManager;
@@ -38,6 +39,7 @@
@Argument(index = 0, name = "pwId",
description = "pseudowire ID",
required = true, multiValued = false)
+ @Completion(PseudowireIdCompleter.class)
String pwId;
@Override
diff --git a/app/src/main/java/org/onosproject/segmentrouting/cli/VerifyGroupsCommand.java b/app/src/main/java/org/onosproject/segmentrouting/cli/VerifyGroupsCommand.java
index 59b4315..299fa2f 100644
--- a/app/src/main/java/org/onosproject/segmentrouting/cli/VerifyGroupsCommand.java
+++ b/app/src/main/java/org/onosproject/segmentrouting/cli/VerifyGroupsCommand.java
@@ -18,8 +18,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.net.DeviceIdCompleter;
import org.onosproject.net.Device;
import org.onosproject.net.DeviceId;
import org.onosproject.net.device.DeviceService;
@@ -39,6 +41,7 @@
@Argument(index = 0, name = "uri", description = "Device ID",
required = true, multiValued = false)
+ @Completion(DeviceIdCompleter.class)
String uri = null;
@Override
diff --git a/app/src/main/java/org/onosproject/segmentrouting/cli/XconnectAddCommand.java b/app/src/main/java/org/onosproject/segmentrouting/cli/XconnectAddCommand.java
index 01c3001..762b9f3 100644
--- a/app/src/main/java/org/onosproject/segmentrouting/cli/XconnectAddCommand.java
+++ b/app/src/main/java/org/onosproject/segmentrouting/cli/XconnectAddCommand.java
@@ -18,9 +18,13 @@
import com.google.common.collect.Sets;
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.VlanId;
import org.onosproject.cli.AbstractShellCommand;
+import org.onosproject.cli.PlaceholderCompleter;
+import org.onosproject.cli.net.DeviceIdCompleter;
+import org.onosproject.cli.net.PortNumberCompleter;
import org.onosproject.net.DeviceId;
import org.onosproject.net.PortNumber;
import org.onosproject.segmentrouting.xconnect.api.XconnectService;
@@ -36,21 +40,25 @@
@Argument(index = 0, name = "deviceId",
description = "Device ID",
required = true, multiValued = false)
+ @Completion(DeviceIdCompleter.class)
private String deviceIdStr;
@Argument(index = 1, name = "vlanId",
description = "VLAN ID",
required = true, multiValued = false)
+ @Completion(PlaceholderCompleter.class)
private String vlanIdStr;
@Argument(index = 2, name = "port1",
description = "Port 1",
required = true, multiValued = false)
+ @Completion(PortNumberCompleter.class)
private String port1Str;
@Argument(index = 3, name = "port2",
description = "Port 2",
required = true, multiValued = false)
+ @Completion(PortNumberCompleter.class)
private String port2Str;
diff --git a/app/src/main/java/org/onosproject/segmentrouting/cli/XconnectRemoveCommand.java b/app/src/main/java/org/onosproject/segmentrouting/cli/XconnectRemoveCommand.java
index e0f77de..e651338 100644
--- a/app/src/main/java/org/onosproject/segmentrouting/cli/XconnectRemoveCommand.java
+++ b/app/src/main/java/org/onosproject/segmentrouting/cli/XconnectRemoveCommand.java
@@ -17,9 +17,12 @@
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.VlanId;
import org.onosproject.cli.AbstractShellCommand;
+import org.onosproject.cli.PlaceholderCompleter;
+import org.onosproject.cli.net.DeviceIdCompleter;
import org.onosproject.net.DeviceId;
import org.onosproject.segmentrouting.xconnect.api.XconnectService;
@@ -32,11 +35,13 @@
@Argument(index = 0, name = "deviceId",
description = "Device ID",
required = true, multiValued = false)
+ @Completion(DeviceIdCompleter.class)
private String deviceIdStr;
@Argument(index = 1, name = "vlanId",
description = "VLAN ID",
required = true, multiValued = false)
+ @Completion(PlaceholderCompleter.class)
private String vlanIdStr;
@Override