Thomas Vachuska | d821c75 | 2018-02-26 11:33:35 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2018-present Open Networking Foundation |
| 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 | package org.onosproject.routescale; |
| 17 | |
| 18 | import org.apache.karaf.shell.commands.Argument; |
| 19 | import org.apache.karaf.shell.commands.Command; |
| 20 | import org.onosproject.cli.AbstractShellCommand; |
| 21 | |
| 22 | /** |
| 23 | * Creates the specified number of routes for scale testing. |
| 24 | */ |
| 25 | @Command(scope = "onos", name = "scale-create-routes", |
| 26 | description = "Creates the specified number of routes for scale testing") |
| 27 | public class CreateRoutes extends AbstractShellCommand { |
| 28 | |
| 29 | @Argument(index = 0, name = "routeCount", description = "Number of routes to create", |
| 30 | required = true) |
| 31 | int routeCount; |
| 32 | |
| 33 | @Override |
| 34 | protected void execute() { |
| 35 | ScaleTestManager service = get(ScaleTestManager.class); |
| 36 | service.createRoutes(routeCount); |
| 37 | } |
| 38 | |
| 39 | } |