Refine search
@Command(scope = "shell", name = "printf", description = "Formats and prints arguments.") @Service public class PrintfAction implements Action { @Argument(index = 0, name = "format", description = "The format pattern to use", required = true, multiValued = false) private String format; @Argument(index = 1, name = "arguments", description = "The arguments for the given format pattern", required = true, multiValued = true) private Collection<Object> arguments = null; @Override public Object execute() throws Exception { System.out.printf(format, arguments.toArray()); return null; } }
@Command(scope = "shell", name = "printf", description = "Formats and prints arguments.") @Service public class PrintfAction implements Action { @Argument(index = 0, name = "format", description = "The format pattern to use", required = true, multiValued = false) private String format; @Argument(index = 1, name = "arguments", description = "The arguments for the given format pattern", required = true, multiValued = true) private Collection<Object> arguments = null; @Override public Object execute() throws Exception { System.out.printf(format, arguments.toArray()); return null; } }
@Command(scope = "obr", name = "url-add", description = "Adds a list of repository URLs to the OBR service.") @Service public class AddUrlCommand extends ObrCommandSupport { @Argument(index = 0, name = "urls", description = "Repository URLs to add to the OBR service separated by whitespaces", required = true, multiValued = true) List<String> urls; protected void doExecute(RepositoryAdmin admin) throws Exception { for (String url : urls) { admin.addRepository(url); } persistRepositoryList(admin); } }
@Command(scope = "config", name = "property-delete", description = "Deletes a property from the configuration being edited.") @Service public class PropDelCommand extends ConfigPropertyCommandSupport { @Argument(index = 0, name = "property", description = "The name of the property to delete", required = true, multiValued = false) String prop; @Override public void propertyAction(TypedProperties props) { props.remove(prop); } }
@Command(scope = "config", name = "property-delete", description = "Deletes a property from the configuration being edited.") @Service public class PropDelCommand extends ConfigPropertyCommandSupport { @Argument(index = 0, name = "property", description = "The name of the property to delete", required = true, multiValued = false) String prop; @Override public void propertyAction(TypedProperties props) { props.remove(prop); } }
@Command(scope = "obr", name = "url-add", description = "Adds a list of repository URLs to the OBR service.") @Service public class AddUrlCommand extends ObrCommandSupport { @Argument(index = 0, name = "urls", description = "Repository URLs to add to the OBR service separated by whitespaces", required = true, multiValued = true) List<String> urls; protected void doExecute(RepositoryAdmin admin) throws Exception { for (String url : urls) { admin.addRepository(url); } persistRepositoryList(admin); } }
@Command(scope = "jms", name = "count", description = "Count the number of messages on a JMS queue.") @Service public class CountCommand extends JmsConnectionCommandSupport { @Argument(index = 1, name = "queue", description = "The JMS queue name", required = true, multiValued = false) String queue; @Override public Object execute() throws Exception { ShellTable table = new ShellTable(); table.column("Messages Count"); table.addRow().addContent(getJmsService().count(connectionFactory, queue, username, password)); table.print(System.out); return null; } }
@Command(scope = "xi", name = "confirm", description = "confirm an action") @Service public static class Confirm extends XiAction { @Argument(index = 0, name = "message", required = true, description = "prompt message") private String prompt; @Override protected Object execute0() throws Exception { boolean toContinue = confirm(prompt + "\nDo you want to continue", 3); if (!toContinue) { throw new CmdFailure("User cancelled"); } return null; } }
@Command(scope = "feature", name = "provided", description = "List the features provided by a features repository") @Service public class ListProvidedFeaturesCommand extends FeaturesCommandSupport { @Argument(index = 0, name = "repo", description = "The features repository URI", required = true, multiValued = false) URI featuresRepositoryUri; @Override protected void doExecute(FeaturesService service) throws Exception { ShellTable table = new ShellTable(); table.column("Name"); table.column("Version"); for (Feature feature : service.repositoryProvidedFeatures(featuresRepositoryUri)) { table.addRow().addContent(feature.getName(), feature.getVersion()); } table.print(System.out); } }
@Command(scope = "docker", name = "tag", description = "Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE") @Service public class TagCommand extends DockerCommandSupport { @Argument(index = 0, name = "image", description = "ID or name of the image to tag", required = true, multiValued = false) @Completion(ImagesRepoTagsCompleter.class) String image; @Argument(index = 1, name = "tag", description = "Tag", required = true, multiValued = false) String tag; @Argument(index = 2, name = "repo", description = "Repository where to tag", required = false, multiValued = false) String repo; @Override public Object execute() throws Exception { getDockerService().tag(image, repo, tag, url); return null; } }
@Command(scope = "instance", name = "opts-change", description = "Changes the Java options of an existing container instance.") @Service public class ChangeOptsCommand extends InstanceCommandSupport { @Argument(index = 0, name = "name", description="The name of the container instance", required = true, multiValued = false) @Completion(InstanceCompleter.class) private String instance = null; @Argument(index = 1, name = "javaOpts", description = "The new Java options to set", required = true, multiValued = false) private String javaOpts; protected Object doExecute() throws Exception { getExistingInstance(instance).changeJavaOpts(javaOpts); return null; } }
@Command(scope = "config", name = "property-set", description = "Sets a property in the currently edited configuration.") @Service public class PropSetCommand extends ConfigPropertyCommandSupport { @Argument(index = 0, name = "property", description = "The name of the property to set", required = true, multiValued = false) @Completion(ConfigurationPropertyCompleter.class) String prop; @Argument(index = 1, name = "value", description = "The value of the property", required = true, multiValued = false) Object value; @Override public void propertyAction(TypedProperties props) { props.put(prop, value); } }
@Command(scope = "instance", name = "rmi-registry-port-change", description = "Changes the RMI registry port (used by management layer) of an existing container instance.") @Service public class ChangeRmiRegistryPortCommand extends InstanceCommandSupport { @Argument(index = 0, name = "name", description = "The name of the container instance", required = true, multiValued = false) @Completion(InstanceCompleter.class) private String instance = null; @Argument(index = 1, name = "port", description = "The new RMI registry port to set", required = true, multiValued = false) private int port = 0; protected Object doExecute() throws Exception { getExistingInstance(instance).changeRmiRegistryPort(port); return null; } }
@Command(scope = "instance", name = "rmi-server-port-change", description = "Changes the RMI server port (used by management layer) of an existing instance.") @Service public class ChangeRmiServerPortCommand extends InstanceCommandSupport { @Argument(index = 0, name = "name", description = "The name of the container instance", required = true, multiValued = false) @Completion(InstanceCompleter.class) private String instance = null; @Argument(index = 1, name = "port", description = "The new RMI server port to set", required = true, multiValued = false) private int port = 0; protected Object doExecute() throws Exception { getExistingInstance(instance).changeRmiServerPort(port); return null; } }
@Command(scope = "instance", name = "ssh-port-change", description = "Changes the secure shell port of an existing container instance.") @Service public class ChangeSshPortCommand extends InstanceCommandSupport { @Argument(index = 0, name = "name", description="The name of the container instance", required = true, multiValued = false) @Completion(InstanceCompleter.class) private String instance = null; @Argument(index = 1, name = "port", description = "The new secure shell port to set", required = true, multiValued = false) private int port = 0; protected Object doExecute() throws Exception { getExistingInstance(instance).changeSshPort(port); return null; } }
/** * Removes a controller cluster node. */ @Service @Command(scope = "onos", name = "remove-node", description = "Removes a new controller cluster node") public class NodeRemoveCommand extends AbstractShellCommand { @Argument(index = 0, name = "nodeId", description = "Node ID", required = true, multiValued = false) String nodeId = null; @Override protected void doExecute() { ClusterAdminService service = get(ClusterAdminService.class); service.removeNode(new NodeId(nodeId)); } }
@Command(scope = "instance", name = "ssh-host-change", description = "Changes the secure shell host of an existing container instance.") @Service public class ChangeSshHostCommand extends InstanceCommandSupport { @Argument(index = 0, name = "name", description="The name of the container instance", required = true, multiValued = false) @Completion(StoppedInstanceCompleter.class) private String instance = null; @Argument(index = 1, name = "host", description = "The new secure shell host to set", required = true, multiValued = false) private String host = "0.0.0.0"; protected Object doExecute() throws Exception { getExistingInstance(instance).changeSshHost(host); return null; } }
@Command(scope = "instance", name = "opts-change", description = "Changes the Java options of an existing container instance.") @Service public class ChangeOptsCommand extends InstanceCommandSupport { @Argument(index = 0, name = "name", description="The name of the container instance", required = true, multiValued = false) @Completion(InstanceCompleter.class) private String instance = null; @Argument(index = 1, name = "javaOpts", description = "The new Java options to set", required = true, multiValued = false) private String javaOpts; protected Object doExecute() throws Exception { getExistingInstance(instance).changeJavaOpts(javaOpts); return null; } }
@Command(scope = "instance", name = "rmi-registry-port-change", description = "Changes the RMI registry port (used by management layer) of an existing container instance.") @Service public class ChangeRmiRegistryPortCommand extends InstanceCommandSupport { @Argument(index = 0, name = "name", description = "The name of the container instance", required = true, multiValued = false) @Completion(InstanceCompleter.class) private String instance = null; @Argument(index = 1, name = "port", description = "The new RMI registry port to set", required = true, multiValued = false) private int port = 0; protected Object doExecute() throws Exception { getExistingInstance(instance).changeRmiRegistryPort(port); return null; } }
@Command(scope = "instance", name = "rmi-server-port-change", description = "Changes the RMI server port (used by management layer) of an existing instance.") @Service public class ChangeRmiServerPortCommand extends InstanceCommandSupport { @Argument(index = 0, name = "name", description = "The name of the container instance", required = true, multiValued = false) @Completion(InstanceCompleter.class) private String instance = null; @Argument(index = 1, name = "port", description = "The new RMI server port to set", required = true, multiValued = false) private int port = 0; protected Object doExecute() throws Exception { getExistingInstance(instance).changeRmiServerPort(port); return null; } }