jcc | de3e92e | 2015-03-28 01:40:44 -0700 | [diff] [blame] | 1 | package org.onosproject.cli.net; |
| 2 | |
| 3 | import org.apache.karaf.shell.commands.Argument; |
| 4 | import org.apache.karaf.shell.commands.Command; |
| 5 | import org.onosproject.cli.AbstractShellCommand; |
| 6 | import org.onosproject.net.resource.LabelResourceAdminService; |
| 7 | import org.onosproject.net.resource.LabelResourceId; |
| 8 | |
| 9 | /** |
| 10 | * create label resource pool by specific device id. |
| 11 | */ |
| 12 | @Command(scope = "onos", name = "create-global-label-resource-pool", |
| 13 | description = "Creates global label resource pool.") |
| 14 | public class CreateGlobalLabelResourcePoolCommand extends AbstractShellCommand { |
| 15 | @Argument(index = 0, name = "beginLabel", |
| 16 | description = "The first label of global label resource pool.", |
| 17 | required = true, multiValued = false) |
| 18 | String beginLabel = null; |
| 19 | @Argument(index = 1, name = "endLabel", |
| 20 | description = "The last label of global label resource pool.", |
| 21 | required = true, multiValued = false) |
| 22 | String endLabel = null; |
| 23 | |
| 24 | @Override |
| 25 | protected void execute() { |
| 26 | LabelResourceAdminService lrs = get(LabelResourceAdminService.class); |
| 27 | lrs.createGlobalPool(LabelResourceId.labelResourceId(Long |
| 28 | .parseLong(beginLabel)), LabelResourceId.labelResourceId(Long |
| 29 | .parseLong(endLabel))); |
| 30 | } |
| 31 | |
| 32 | } |