Hyunsun Moon | cbc885f | 2016-03-08 15:37:57 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | 80dff97 | 2017-08-03 22:46:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
Hyunsun Moon | cbc885f | 2016-03-08 15:37:57 -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 | */ |
alshabib | b4d3171 | 2016-06-01 18:51:03 -0700 | [diff] [blame] | 16 | package org.opencord.cordvtn.cli; |
Hyunsun Moon | cbc885f | 2016-03-08 15:37:57 -0800 | [diff] [blame] | 17 | |
| 18 | import org.apache.karaf.shell.commands.Command; |
| 19 | import org.onosproject.cli.AbstractShellCommand; |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 20 | import org.opencord.cordvtn.api.core.CordVtnPipeline; |
Hyunsun Moon | cbc885f | 2016-03-08 15:37:57 -0800 | [diff] [blame] | 21 | |
| 22 | /** |
Hyunsun Moon | 6066bd3 | 2016-10-24 15:35:34 -0700 | [diff] [blame] | 23 | * Purges all flow rules installed by CORD VTN service. |
Hyunsun Moon | cbc885f | 2016-03-08 15:37:57 -0800 | [diff] [blame] | 24 | */ |
Hyunsun Moon | 6066bd3 | 2016-10-24 15:35:34 -0700 | [diff] [blame] | 25 | @Command(scope = "onos", name = "cordvtn-purge-rules", |
| 26 | description = "Purges all flow rules installed by CORD VTN") |
| 27 | public class CordVtnPurgeRulesCommand extends AbstractShellCommand { |
Hyunsun Moon | cbc885f | 2016-03-08 15:37:57 -0800 | [diff] [blame] | 28 | |
| 29 | @Override |
| 30 | protected void execute() { |
Hyunsun Moon | e7e4bb3 | 2016-05-16 04:32:45 -0700 | [diff] [blame] | 31 | CordVtnPipeline pipeline = AbstractShellCommand.get(CordVtnPipeline.class); |
Hyunsun Moon | 2c3f0ee | 2017-04-06 16:47:21 +0900 | [diff] [blame] | 32 | pipeline.cleanupPipeline(); |
Hyunsun Moon | cbc885f | 2016-03-08 15:37:57 -0800 | [diff] [blame] | 33 | } |
| 34 | } |