blob: b4f2385ebd35aa197e57a1e6f0ab7cf868ebcc9e [file] [log] [blame]
tomc290a122014-09-08 14:27:13 -07001package org.onlab.onos.cli.net;
2
3import org.apache.karaf.shell.commands.Argument;
4import org.apache.karaf.shell.commands.Command;
5import org.onlab.onos.cli.AbstractShellCommand;
6import org.onlab.onos.net.DeviceId;
7import org.onlab.onos.net.device.DeviceAdminService;
8
9/**
10 * Removes an infrastructure device.
11 */
12@Command(scope = "onos", name = "device-remove",
13 description = "Removes an infrastructure device")
14public class DeviceRemoveCommand extends AbstractShellCommand {
15
16 @Argument(index = 0, name = "uri", description = "Device ID",
17 required = true, multiValued = false)
18 String uri = null;
19
20 @Override
21 protected Object doExecute() throws Exception {
22 getService(DeviceAdminService.class).removeDevice(DeviceId.deviceId(uri));
23 return null;
24 }
25
26}