blob: d01e8e2f486e1df6b44c4ab19e1e77f5a2de1a6b [file] [log] [blame]
alshabibe0559672016-02-21 14:49:51 -08001/*
Brian O'Connord6a135a2017-08-03 22:46:05 -07002 * Copyright 2016-present Open Networking Foundation
alshabibe0559672016-02-21 14:49:51 -08003 *
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
alshabib36a4d732016-06-01 16:03:59 -070017package org.opencord.olt.cli;
alshabibe0559672016-02-21 14:49:51 -080018
alshabibe0559672016-02-21 14:49:51 -080019import org.apache.karaf.shell.commands.Command;
20import org.onosproject.cli.AbstractShellCommand;
Amit Ghosh1ed9aef2018-07-17 17:08:16 +010021import org.opencord.olt.AccessDeviceService;
alshabibe0559672016-02-21 14:49:51 -080022
23/**
Jonathan Hartfd6c1b32016-03-08 14:09:09 -080024 * Shows configured OLTs.
alshabibe0559672016-02-21 14:49:51 -080025 */
Saurav Das82b8e6d2018-10-04 15:25:12 -070026@Command(scope = "onos", name = "volt-olts",
27 description = "Shows vOLTs connected to ONOS")
alshabibe0559672016-02-21 14:49:51 -080028public class ShowOltCommand extends AbstractShellCommand {
29
alshabibe0559672016-02-21 14:49:51 -080030 @Override
31 protected void execute() {
32 AccessDeviceService service = AbstractShellCommand.get(AccessDeviceService.class);
Amit Ghosh1ed9aef2018-07-17 17:08:16 +010033 service.fetchOlts().forEach(did -> {
34 print("OLT %s", did);
35 });
alshabibe0559672016-02-21 14:49:51 -080036 }
37}