Installation of the Command-Line Client

RAW includes a command-line client (CLI) that allows the execution of queries and other operations on a RAW server from the shell.

Prerequisites

  • Python 3 (Python 3.5 or later). If running on a Windows machine without administrator privileges, consider using Anaconda.

  • pip (if not already installed, Anaconda comes with pip.)

  • RAW Python API: refer to the Installation of the Python API

Installation

Please go to the RAW frontend downloads web page by clicking: Settings >> Install.

there click on the download link for your corresponding operative system (Windows, Linux or MacOS).

To install open a terminal where you downloaded the file and run the following command:

$ pip3 install <downloaded file> --user

For usage instructions, run rawcli --help.

Alternatively, it is possible to use virtualenv to install the client in an isolated environment, e.g:

$ virtualenv rawcli
$ source rawcli/bin/activate
$ pip3 install <downloaded file>

Configuration

The rawcli tool will look for a configuration called raw.ini in the following locations in order:

  1. Environment variable: RAW_CLIENT_CONFIG_FILE

  2. <current directory>/raw.ini

  3. <user home directory>/.raw.ini

Alternatively, it is possible to specify a configuration file by using the -c option.

$ rawcli -c <config> ...

The following is an example of a simple configuration, where the RAW server is running on localhost in unsafe mode:

[raw]
executor_url = http://localhost:54321
creds_url = http://localhost:54321
auth = basic
disable_tls_cert_verification = false

[auth_basic]
access_token = token

If using a TLS connection (e.g., when the connection between the client and the RAW services is proxied using TLS), it is possible to disable verification of the TLS certificate by setting disable_tls_cert_verification to true. This is useful in cases where the system is using self-signed certificates or certificates that were issued with a different name than the endpoint used to access the RAW servers.

If RAW is using Auth0 for user management and authentication, use the following configuration (the missing values will be provided).

[raw]
executor_url = <EXECUTOR-ADDRESS>
creds_url = <CREDS-SERVER-ADDRESS>
auth = auth0

[auth0]
domain = raw.eu.auth0.com
audience = https://just-ask.raw-labs.com

auth_type = client_credentials
client_id = <AUTH0 CLIENT ID>
client_secret = <AUTH0 CLIENT SECRET>

Usage

To following commands can be used to test the installation:

  • rawcli -c raw.ini version handled by the RAW Executor.

  • rawcli -c raw.ini rdmbs-list handled by the RAW Creds.

For further instructions, refer to Using the Command-Line Client.