Qorus Integration Engine  3.0.4.p7
ocmd: Command-Line Interface to the Qorus RPC API

Usage
ocmd [options] method [arguments]

This command provides a command-line interface to the Qorus RPC API. It executes by connecting to the Qorus HTTP server and issuing YAML-RPC, XML-RPC, or JSON-RPC commands. Responses are deserialized into a Qore data structure, and the resulting data is then displayed on the screen.

By default, ocmd uses the YAML-RPC protocol to communicate with the Qorus server.

To submit XML-RPC web service calls, specify xmlrpc or xmlrpcs (for XML-RPC over a TLS/SSL-encrypted HTTPS transport) protocol in the URL (ex: "xmlrpc://server1:8501"), however please note that XML-RPC does not support time zones or fractional second resolution, so date/time information returned by the server may not be displayed correctly by client programs when this protocol is used.

To submit JSON-RPC web service calls, specify jsonrpc or jsonrpcs (for JSON-RPC over a TLS/SSL-encrypted HTTPS transport) protocol in the URL (ex: "jsonrpc://server1:8501"), however please note that JSON does not have native date/time or binary types, so such information returned by the server may not be displayed correctly by client programs when this protocol is used.

Note that arguments may be given in the Qore programming language syntax; ocmd will attempt to parse the command-line arguments as Qore code and pass them to the method. Additionally, text separated by commas will be interpreted as a list, and text in the form name=value[,name=value...] will be interpreted as a hash. In this way complex arguments can be passed to the method to be called.

For example, to get help on system API method omq.system.add-user():

unixprompt% ocmd help add-user

Be aware that this program is delivered as a Qore-language script, and, as such, requires either the $OMQ_DIR or $QORE_MODULE_DIR environment variables to be set to find the Qorus client module, if not located in the default location.

Note
Any API method supported by Qorus can be called from the command-line by using this program (including methods which act as gateways to system and user services). However, several other programs have been developed to provide a more user-friendly interface to some common functions.

Options Supported by ocmd

Long Option Short Description
–help -h Prints command help text
–unformatted-xml -X Shows the literal YAML, XML, or JSON response (unformatted)
–url=ARG -u Set URL: "http://host:port"; at least host or port must be given; ex: "http://server1:8501/RPC2"; see UNIX Socket Support in URLs
–proxy-url=ARG -p Set the proxy URL: "http://host:port"; at least host or port must be given; ex: "http://proxy1:8080"; see UNIX Socket Support in URLs
–verbose -v Shows more information about the web service call
–xml -x Shows the literal YAML, XML, or JSON response (formatted)
–foreign -f Do not process the method name (do not prepend "omq.system." to method names not containing a '.')
–show-url -W Show the system URL as parsed from the option file
–timeout=ARG -t Set the HTTP timeout in seconds (also the connect timeout)
–monitor -m Monitor network events – shows details about all network communication with the Qorus server
–literal -l Show literal responses, giving the option 2 times shows HTTP headers