blob: 13a893ba55f2d9f56dfe807940b571a78a1c5761 [file] [log] [blame]
Thomas Vachuska7d693f52014-10-21 19:17:57 -07001/*
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07002 * Copyright 2014 Open Networking Laboratory
Thomas Vachuska7d693f52014-10-21 19:17:57 -07003 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07004 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
Thomas Vachuska7d693f52014-10-21 19:17:57 -07007 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07008 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
Thomas Vachuska7d693f52014-10-21 19:17:57 -070015 */
tomc290a122014-09-08 14:27:13 -070016package org.onlab.onos.cli.net;
17
18import org.apache.karaf.shell.commands.Argument;
19import org.apache.karaf.shell.commands.Command;
20import org.onlab.onos.cli.AbstractShellCommand;
21import org.onlab.onos.net.DeviceId;
22import org.onlab.onos.net.device.DeviceAdminService;
23
24/**
25 * Removes an infrastructure device.
26 */
27@Command(scope = "onos", name = "device-remove",
28 description = "Removes an infrastructure device")
29public class DeviceRemoveCommand extends AbstractShellCommand {
30
31 @Argument(index = 0, name = "uri", description = "Device ID",
32 required = true, multiValued = false)
33 String uri = null;
34
35 @Override
tom0872a172014-09-23 11:24:26 -070036 protected void execute() {
tomcaf3bf72014-09-23 13:20:53 -070037 get(DeviceAdminService.class).removeDevice(DeviceId.deviceId(uri));
tomc290a122014-09-08 14:27:13 -070038 }
39
40}