Modified scm section.
[unimgr.git] / cli / src / main / java / org / opendaylight / unimgr / cli / EvcRemoveShellCommand.java
1 /*
2  * Copyright (c) 2015 CableLabs and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.unimgr.cli;
9
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.unimgr.api.IUnimgrConsoleProvider;
14
15 @Command(name = "remove", scope = "Evc", description = "Removes Evc.")
16 public class EvcRemoveShellCommand extends OsgiCommandSupport {
17
18     protected IUnimgrConsoleProvider provider;
19
20     @Argument(index = 0, name = "id", description = "Evc Id", required = true, multiValued = false)
21     String id;
22
23     public EvcRemoveShellCommand(IUnimgrConsoleProvider provider) {
24         this.provider = provider;
25     }
26
27     @Override
28     protected Object doExecute() throws Exception {
29         if (provider.removeEvc(id)) {
30             return String.format("Evc successfully removed");
31         } else {
32             return String.format("Error removing Evc");
33         }
34     }
35
36 }