blob: ad17290cf3c407acec77980ffe8c055f511d0df3 [file] [log] [blame]
tomf5c9d922014-10-03 15:22:03 -07001package org.onlab.onos.cli.net;
2
3import org.apache.karaf.shell.commands.Command;
4import org.onlab.onos.cli.AbstractShellCommand;
5import org.onlab.onos.net.intent.Intent;
6import org.onlab.onos.net.intent.IntentService;
7
8/**
9 * Lists the inventory of intents and their states.
10 */
11@Command(scope = "onos", name = "intents",
12 description = "Lists the inventory of intents and their states")
13public class IntentsListCommand extends AbstractShellCommand {
14
15 @Override
16 protected void execute() {
17 IntentService service = get(IntentService.class);
18 for (Intent intent : service.getIntents()) {
19 print("%s", intent);
20 }
21 }
22
23}