From cfb9a5f688e6347408cee46ce04dd1ed7851107d Mon Sep 17 00:00:00 2001
From: jjg-123 The latest version of the Oauth 2.0 command line tool is available at
-oa2-cli.jar
-You should also get the script that runs this too,
-oa2-cli
+
+ Generally you should use the installer
+ and follow the instructions for that. This will deploy and configure a fully functional
+ CLI for your server. If you really insist on downloading and running the jar manually,
+ please the Appendix.
The tool uses a standard configuration file exactly like the server. Indeed, you can
+(and generally should) just
point the tool at the server configuration file. You will need to supply the name of
-the configuration in the file you want to use. Aliases can be quite handy here. Given the abilities of
+the configuration in the file you want to use. Configuration file aliases (these are internal
+to the can be quite handy here. Given the abilities of
the CLI to do quick copies of the store, it pays to have a backup (file) store configured and
occasionally simple copy the active store to that. There are many possible uses. It is assumed that
-the tools are installed in a location called $OA4MP_HOME. Normally the default for this is
+the tools are installed in a location called $OA4MP_SERVER. Normally the default for this is
The assumption of the script is that files are in the following directory structure The default name of the configuration is assumed to be "default" (no quotes). If you invoke the script with
+ no arguments it will use this and the above configuration file. Invocation syntax is Note that you may shorten the list, but cannot, e.g., just supply the configuration file. For every command you may add the switch Command line tools for OA4MP
These are a set of programs that are accessible from a CLI
@@ -84,98 +81,42 @@ records and approvals. There is also the option to copy a store completely from
store to another.
Getting the tools
-
-Configuration
-The tool uses a standard configuration file exactly like the server. Indeed, you can just
+
+Configuration
+
-OAuth 1.0a: OA4MP_HOME=/opt/oa4mp
-
-OAuth 2.0: OA4MP_HOME=opt/oa2
-
-Note that we will be discussing the OA4MP tools rather than the OA2 tools in what follows.
- Everything here works the same if you replace oa4mp-* by oa2-*
+OA4MP_SERVER=/opt/oa4mp/server
+
-
-The default name of the configuration is assumed to be "default" (no quotes). If you invoke the script with
-no arguments it will use this and the above configuration file.
-
-$OA4MP_HOME/etc/admin-cfg.xml
- the configuration file$OA4MP_HOME/lib/oa4mp-cli.jar
- the jar containing the CLI$OA4MP_HOME/bin/oa4mp-cli
- the script for running this. Be sure it is set to be executable.$OA4MP_SERVER/etc/admin-cfg.xml
- the configuration file$OA4MP_SERVER/lib/cli.jar
- the jar containing the CLI$OA4MP_SERVER/bin/cli
- the script for running this. Be sure it is set to be executable.Running the CLI
-Invocation from the command line is usually done with the supplied shell script, oa4mp-cli. The
-invocation syntax is
-
-oa4mp-cli [configName configFile]
-
-You should run this as root and might need to set the script to be
-executable if it is not. If you give neither arguments then defaults are used. Invoke with the argument "--help"
-for more information. If you give one argument it is assumed to be the configuration name
-in the default configuration file.
-Command line options for the jar.
-You should run this from the script, but if you want or need to specify
-invoke the jar directly, the invocation options they are listed here.
-
-
-
-
-
- Argument
- Value required?
- Required?
- Description
-
-
- -cfg
- Y
- Y
- The full path to the configuration file.
-
-
- -name
- F
- F
- The name of the configuration within the file. If there is a single configuration
- in the file, then no name is needed. If there are multiple configurations you must specify which one to use.
-
-
- -log
- F
- F
- The full path log file. If this is not specified then a file named "log.xml"
- is dumped into the invocation directory.
-
-
- -use
- F
- F
- Specify the component to use. Rather than loading the whole CLI then use-ing
- a components (such as clients) you may simply specify that here.
-
-
-
--v
- F
- F
- No argument. Turns on verbose logging so that much more information is dumped
- onto the console. This is useful for debugging or just if you want to see what it is up to.
-
- java -jar oa4mp-cli.jar -cfg /path/to/cfg.xml -name myConfig -log /path/to/mylog.xml -use approvals
-
-This would load the configuration named "myConfig" from the given file, write the log to a file called
-"mylog.xml" and bring up the approvals component.
+java -jar $OA4MP_SERVER/lib/cli.jar [configName configFile env]
+
+
+Help!
--help
and you will get
@@ -227,14 +168,16 @@ view the help for the ls command:
There are commands to do tasks and there are meta-commands that control how the +
The OA4MP CLI extends the NCSA CLI framework, + so meta commands are more fully discussed there. + There are commands to do tasks and there are meta-commands that control how the CLI itself operates. These are prefixed with a backslash /. E.g. to quit a component, issue
/q
A full listing of meta commands is done with the ?:
/?-
Extremely use meta-commands are a command history, executing a command in another component -with out switching from the current one, saving you command history (useful if you want +
Commonly used meta-commands are a command history, executing a command in another component +without switching from the current one, saving you command history (useful if you want to use a set of commands as a basis for some scripting). To list the commands available for the admin component, you would issue
@@ -264,7 +207,7 @@ will just change to that component and exiting it will return to you the origina The CLI consists of utilities for each component that can be used. Once invoked you will see the startup banner and prompt:-[mybox bin]# ./oa4mp-cli +[mybox bin]# ./cli ********************************************************** * OA4MP CLI (Command Line Interpreter) * * Version 6.0 * @@ -274,11 +217,11 @@ the startup banner and prompt: * type 'help' for a list of commands * * 'exit' or 'quit' to end this session. * ********************************************************** -oa2> +oa4mp>If you type "--help" You will get-oa2>--help +oa4mp>--help Here are the commands available: use @@ -296,7 +239,7 @@ Basic supported commands are To see the help for, say, the use command you would issue- oa2>use --help + oa4mp>use --help Choose the component you wish to use. you specify the component as use + name. Supported components are clients - edit client records @@ -351,8 +294,8 @@ operations with thecommand. Related is the get_id to display the current id and the clear_id to clear it. If you have an default id set, you do not need to specify one.
- oa2>set_id foo:bar/34456 - oa2>ls -l + oa4mp>set_id foo:bar/34456 + oa4mp>ls -l name : My test thing id : foo:bar/34456@@ -382,12 +325,12 @@ This will print the number of elements in the current storage component.
Example. For showing the number of clients in a store you would have something like the following-oa2>use clients +oa4mp>use clients clients >size Current store has 22 entries clients >exit exiting ... -oa2> +oa4mp>Listing Object or Details of an Object.
@@ -644,7 +587,7 @@ deserialization commands against it repeatedly as you debug it.Clients
Invoke as -oa2> use clients+oa4mp> use clientsOperations allowed in addition to the standard ones are
oa2> use approvals+
oa4mp> use approvalsThere are no extra options beyond the standard ones, however, the
create
command
takes the unique id of the client record you are going to approve. Once created, you may enter the
approval information directly.
oa2>use copy+
oa4mp>use copySupported operation is
You can just download the jar and configure it manually, though that is a lot more + work than the installer. One cogent argument is incorporating the CLI into your own custome scripts. + This section is how to run the CLI fromthe jara manually. If you use the installer, + skip this section.
+The latest version of the OA4MP command line tool is available at + cli.jar + You should also get the script that runs this too, + cli +
+If you are pointing to the server configuration, you will probably need to run this as root + to get access top that file. If you invoke the CLI with no arguments, it will tell + you there is no configuration, but you can use all of the online help. + You need the configuration file and name of the configuration generally to get a working + CLI.
+ +invocation syntax is just like any other executable jar
+ +java -jar $OA4MP_SERVER/lib/cli.jar options+ +
Argument | +Value required? | +Required? | +Description | +
-cfg | +Y | +Y | +The full path to the configuration file. | +
-name | +F | +F | +The name of the configuration within the file. If there is a single configuration + in the file, then no name is needed. If there are multiple configurations you must specify which one to use. | +
-log | +F | +F | +The full path log file. If this is not specified then a file named "log.xml" + is dumped into the invocation directory. | +
-use | +F | +F | +Specify the component to use. Rather than loading the whole CLI then use-ing + a components (such as clients) you may simply specify that here. | +
-v | +F | +F | +No argument. Turns on verbose logging so that much more information is dumped + onto the console. This is useful for debugging or just if you want to see what it is up to. | +
+ java -jar cli.jar -cfg /path/to/cfg.xml -name myConfig -log /path/to/mylog.xml -use approvals ++This would load the configuration named "myConfig" from the given file, write the log to a file called +"mylog.xml" and bring up the approvals component. - \ No newline at end of file