tom | 9710fb4 | 2014-09-29 11:35:28 -0700 | [diff] [blame] | 1 | package org.onlab.onos.cli; |
| 2 | |
| 3 | import org.apache.karaf.shell.commands.Argument; |
| 4 | import org.apache.karaf.shell.commands.Command; |
| 5 | import org.onlab.onos.cluster.ClusterAdminService; |
| 6 | import org.onlab.onos.cluster.NodeId; |
| 7 | |
| 8 | /** |
| 9 | * Removes a controller cluster node. |
| 10 | */ |
| 11 | @Command(scope = "onos", name = "remove-node", |
| 12 | description = "Removes a new controller cluster node") |
| 13 | public class NodeRemoveCommand extends AbstractShellCommand { |
| 14 | |
| 15 | @Argument(index = 0, name = "nodeId", description = "Node ID", |
| 16 | required = true, multiValued = false) |
| 17 | String nodeId = null; |
| 18 | |
| 19 | @Override |
| 20 | protected void execute() { |
| 21 | ClusterAdminService service = get(ClusterAdminService.class); |
| 22 | service.removeNode(new NodeId(nodeId)); |
| 23 | } |
| 24 | |
| 25 | } |