2 * Copyright (c) 2017 AT&T Intellectual Property. 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.protocol.bgp.cli;
10 import org.apache.karaf.shell.api.action.Action;
11 import org.apache.karaf.shell.api.action.Command;
12 import org.apache.karaf.shell.api.action.Option;
13 import org.apache.karaf.shell.api.action.lifecycle.Reference;
14 import org.apache.karaf.shell.api.action.lifecycle.Service;
15 import org.apache.karaf.shell.api.console.Session;
16 import org.opendaylight.mdsal.binding.api.DataBroker;
17 import org.opendaylight.protocol.bgp.cli.utils.BGPOperationalStateUtils;
20 @Command(scope = "bgp", name = "operational-state", description = "Shows BGP Operational State.")
21 public final class OperationalStateCommandProvider implements Action {
23 private Session session;
25 private DataBroker dataBroker;
26 @Option(name = "-neighbor", aliases = {"--neighbor"}, description = "Neighbor address")
28 @Option(name = "-rib", aliases = {"--rib"}, description = "Name of RIB", required = true)
30 @Option(name = "-peer-group", aliases = {"--peer-group"}, description = "Name of Peer Group")
34 public Object execute() {
35 BGPOperationalStateUtils.displayBgpOperationalState(this.dataBroker, this.session.getConsole(),
36 this.ribId, this.group, this.peer);