tom | f5c9d92 | 2014-10-03 15:22:03 -0700 | [diff] [blame] | 1 | package org.onlab.onos.cli.net; |
| 2 | |
| 3 | import org.apache.karaf.shell.commands.Command; |
| 4 | import org.onlab.onos.cli.AbstractShellCommand; |
| 5 | import org.onlab.onos.net.intent.Intent; |
| 6 | import 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") |
| 13 | public 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 | } |