2 * Copyright (c) 2015 CableLabs and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.vcpe.cli;
10 import org.apache.karaf.shell.commands.Argument;
11 import org.apache.karaf.shell.commands.Command;
12 import org.apache.karaf.shell.console.OsgiCommandSupport;
13 import org.opendaylight.vcpe.api.IVcpeConsoleProvider;
15 @Command(name = "remove", scope = "Evc", description = "Removes Evc.")
16 public class EvcRemoveShellCommand extends OsgiCommandSupport {
18 protected IVcpeConsoleProvider provider;
20 @Argument(index = 0, name = "id", description = "Evc Id", required = true, multiValued = false)
23 public EvcRemoveShellCommand(IVcpeConsoleProvider provider) {
24 this.provider = provider;
28 protected Object doExecute() throws Exception {
29 if (provider.removeEvc(id)) {
30 return String.format("Evc successfully removed");
32 return String.format("Error removing Evc");