blob: 219c1871d4087de087331dfc013ce75694a85aa4 [file] [log] [blame]
tom9710fb42014-09-29 11:35:28 -07001package org.onlab.onos.cli;
2
3import org.apache.karaf.shell.commands.Argument;
4import org.apache.karaf.shell.commands.Command;
5import org.onlab.onos.cluster.ClusterAdminService;
6import 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")
13public 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}