alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | d6a135a | 2017-08-03 22:46:05 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 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 | |
alshabib | 36a4d73 | 2016-06-01 16:03:59 -0700 | [diff] [blame] | 17 | package org.opencord.olt.cli; |
alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 18 | |
alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 19 | import org.apache.karaf.shell.commands.Command; |
| 20 | import org.onosproject.cli.AbstractShellCommand; |
Amit Ghosh | 1ed9aef | 2018-07-17 17:08:16 +0100 | [diff] [blame] | 21 | import org.opencord.olt.AccessDeviceService; |
alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 22 | |
| 23 | /** |
Jonathan Hart | fd6c1b3 | 2016-03-08 14:09:09 -0800 | [diff] [blame] | 24 | * Shows configured OLTs. |
alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 25 | */ |
Saurav Das | 82b8e6d | 2018-10-04 15:25:12 -0700 | [diff] [blame] | 26 | @Command(scope = "onos", name = "volt-olts", |
| 27 | description = "Shows vOLTs connected to ONOS") |
alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 28 | public class ShowOltCommand extends AbstractShellCommand { |
| 29 | |
alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 30 | @Override |
| 31 | protected void execute() { |
| 32 | AccessDeviceService service = AbstractShellCommand.get(AccessDeviceService.class); |
Amit Ghosh | 1ed9aef | 2018-07-17 17:08:16 +0100 | [diff] [blame] | 33 | service.fetchOlts().forEach(did -> { |
| 34 | print("OLT %s", did); |
| 35 | }); |
alshabib | e055967 | 2016-02-21 14:49:51 -0800 | [diff] [blame] | 36 | } |
| 37 | } |