Package org.onosproject.cli.net
Class LinksListCommand
- java.lang.Object
-
- org.onosproject.cli.AbstractShellCommand
-
- org.onosproject.cli.net.LinksListCommand
-
- All Implemented Interfaces:
org.apache.karaf.shell.api.action.Action,CodecContext
public class LinksListCommand extends AbstractShellCommand
Lists all infrastructure links.
-
-
Field Summary
-
Fields inherited from class org.onosproject.cli.AbstractShellCommand
log
-
-
Constructor Summary
Constructors Constructor Description LinksListCommand()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringcompactLinkString(Link link)Returns a compact string representing the given link.protected voiddoExecute()Body of the shell command.static com.fasterxml.jackson.databind.JsonNodejson(AbstractShellCommand context, Iterable<Link> links)Produces a JSON array containing the specified links.static com.fasterxml.jackson.databind.node.ObjectNodejson(AbstractShellCommand context, Link link)Produces a JSON object for the specified link.static StringlinkString(Link link)Returns a formatted string representing the given link.-
Methods inherited from class org.onosproject.cli.AbstractShellCommand
annotations, annotations, annotations, appId, codec, error, execute, get, getService, jsonForEntity, mapper, outputJson, print
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.onosproject.codec.CodecContext
decode, encode
-
-
-
-
Method Detail
-
doExecute
protected void doExecute()
Description copied from class:AbstractShellCommandBody of the shell command.- Specified by:
doExecutein classAbstractShellCommand
-
json
public static com.fasterxml.jackson.databind.JsonNode json(AbstractShellCommand context, Iterable<Link> links)
Produces a JSON array containing the specified links.- Parameters:
context- context to use for looking up codecslinks- collection of links- Returns:
- JSON array
-
json
public static com.fasterxml.jackson.databind.node.ObjectNode json(AbstractShellCommand context, Link link)
Produces a JSON object for the specified link.- Parameters:
context- context to use for looking up codecslink- link to encode- Returns:
- JSON object
-
linkString
public static String linkString(Link link)
Returns a formatted string representing the given link.- Parameters:
link- infrastructure link- Returns:
- formatted link string
-
-