blob: 9be67254b96303899c8bd02e1bddbb21e1f12c10 [file] [log] [blame]
jccde3e92e2015-03-28 01:40:44 -07001package org.onosproject.cli.net;
2
3import org.apache.karaf.shell.commands.Command;
4import org.onosproject.cli.AbstractShellCommand;
Brian O'Connor6de2e202015-05-21 14:30:41 -07005import org.onosproject.incubator.net.resource.label.LabelResourcePool;
6import org.onosproject.incubator.net.resource.label.LabelResourceService;
jccde3e92e2015-03-28 01:40:44 -07007
8@Command(scope = "onos", name = "get-global-label-resource-pool",
9 description = "Gets global label resource pool information.")
10public 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}