Using the
CLI

Qorus comes with a Python client package (qorus-remote) for working with remote Qorus instances. qorus-remote provisions the execution of command-line programs on remote Qorus servers and displays the output locally in real time. It uses Qorus’s REST API to make API calls and the WebSocket protocol to stream output from the server. Therefore, you can use the command line as well as the IDE to work with Qorus.

Install qorus-remote with:
pip install qorus-remote

ℹ️ Note: On Linux, sometimes pip installs executables into a custom directory; in these cases, it’s necessary to add $HOME/.local/bin to your path in your setup script – i.e. $HOME/.bashrc, or $HOME/.bash_profile ( if you are using zsh then ~/.zprofile or ~/.zshrc )

Now, configure the .netrc file to provide the login information required to access a Qorus remote server. For a Qorus server located at https://localhost:8011 and using the Qorus user adm, you should have:

machine localhost
port 8011
secure yes
login adm
password adm
timeout 120
verbose no

.netrc files are usually placed in the home directory; therefore, write the above contents to a file and save it at:

On Linux and Mac machines:

~/.netrc-qorus-local
On Windows:
%USERPROFILE%\qorus\netrc-qorus-local

Usage

A few of the commands possible with qorus-remote:

  • oload – loads sources and configuration into the Qorus server.
  • qctl – main interface for the qorus cluster.
  • qrest – the command-line REST API interface.
  • qdp – the command-line interface to the Data Provider API

The complete command list is available in our qorus-remote repository

Aliases

It’s recommended to create aliases for each of the commands, like:

On Windows Command Prompt

  • DOSKEY oload=qorus-remote-commands %USERPROFILE%\qorus\netrc-qorus-local oload $*
  • DOSKEY qctl=qorus-remote-commands %USERPROFILE%\qorus\netrc-qorus-local qctl $*
  • DOSKEY qrest=qorus-remote-commands %USERPROFILE%\qorus\netrc-qorus-local qrest $*
  • DOSKEY qdp=qorus-remote-commands %USERPROFILE%\qorus\netrc-qorus-local qdp $*

On Linux and Mac machines

  • alias oload='qorus-remote-commands ~/.netrc-qorus-local oload $*'
  • alias qctl='qorus-remote-commands ~/.netrc-qorus-local qctl $*'
  • alias qrest='qorus-remote-commands ~/.netrc-qorus-local qrest $*'
  • alias qdp='qorus-remote-commands ~/.netrc-qorus-local qdp $*'

and so on…

After setting aliases, you can test the python client (qorus-remote) by:

  • qctl ps – get a list of cluster processes
  • qctl threads qorus-core – get a list of thread stacks for the qorus-core process
  • oload -Ls – lists the services installed in the database
  • qrest system/instance-key – returns the system instance key name from the REST API (configured in $OMQ_DIR/etc/options – change requires a restart)

ℹ️ Note: $OMQ_DIR refers to the /opt/qorus on the Docker container. On all hosts using Docker Compose to run Qorus, this is (docker compose file directory)/omq/user directory; where docker compose file directory is the directory from which you ran the docker-compose up -d command earlier.

Grab your FREE checklist to help you plan and manage your next
AI or Data Science integration project

Grab your FREE application integrations eBook.
You'll quickly learn how to connect your apps and data into robust processes!