blob: 9e470442c48831f1457bb0e8a8eb22f21ed92fb5 [file] [log] [blame]
Jonathan Hart3f4d4432015-05-20 19:27:39 -07001/*
2 * Copyright 2015 Open Networking Laboratory
3 *
4 * 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
7 *
8 * 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.
15 */
16
17package org.onosproject.cordfabric.cli;
18
19import org.apache.karaf.shell.commands.Argument;
20import org.apache.karaf.shell.commands.Command;
21import org.onlab.packet.VlanId;
22import org.onosproject.cli.AbstractShellCommand;
23import org.onosproject.cordfabric.FabricService;
24
25/**
26 * Removes a vlan from the fabric.
27 */
28@Command(scope = "onos", name = "remove-fabric-vlan",
29 description = "Removes a VLAN from the fabric")
30public class FabricRemoveCommand extends AbstractShellCommand {
31
32 @Argument(index = 0, name = "vlanid", description = "VLAN ID",
33 required = true, multiValued = false)
34 private String vlanIdString = null;
35
36 @Override
37 protected void execute() {
38 FabricService service = AbstractShellCommand.get(FabricService.class);
39
40 VlanId vlan = VlanId.vlanId(Short.parseShort(vlanIdString));
41
42 service.removeVlan(vlan);
43 }
44}