tom | c290a12 | 2014-09-08 14:27:13 -0700 | [diff] [blame] | 1 | package org.onlab.onos.cli.net; |
| 2 | |
| 3 | import org.apache.karaf.shell.commands.Argument; |
| 4 | import org.apache.karaf.shell.commands.Command; |
| 5 | import org.onlab.onos.cli.AbstractShellCommand; |
| 6 | import org.onlab.onos.net.DeviceId; |
| 7 | import 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") |
| 14 | public 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 | } |