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.Command; |
| 4 | import org.onosproject.cli.AbstractShellCommand; |
Brian O'Connor | 6de2e20 | 2015-05-21 14:30:41 -0700 | [diff] [blame^] | 5 | import org.onosproject.incubator.net.resource.label.LabelResourcePool; |
| 6 | import org.onosproject.incubator.net.resource.label.LabelResourceService; |
jcc | de3e92e | 2015-03-28 01:40:44 -0700 | [diff] [blame] | 7 | |
| 8 | @Command(scope = "onos", name = "get-global-label-resource-pool", |
| 9 | description = "Gets global label resource pool information.") |
| 10 | public class GetGlobalLabelResourceCommand extends AbstractShellCommand { |
| 11 | private static final String FMT = "deviceid=%s, beginLabel=%s," |
| 12 | + "endLabel=%s, totalNum=%s, usedNum=%s, currentUsedMaxLabelId=%s," |
| 13 | + "releaseLabelIds=%s"; |
| 14 | |
| 15 | @Override |
| 16 | protected void execute() { |
| 17 | LabelResourceService lrs = get(LabelResourceService.class); |
| 18 | LabelResourcePool pool = lrs.getGlobalLabelResourcePool(); |
| 19 | if (pool != null) { |
| 20 | print(FMT, pool.deviceId().toString(), pool.beginLabel(), |
| 21 | pool.endLabel(), pool.totalNum(), pool.usedNum(), |
| 22 | pool.currentUsedMaxLabelId(), pool.releaseLabelId() |
| 23 | .toString()); |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | } |