ibm-lh-client commands and usage

The ibm-lh-client package includes utilities for SSL certificate management and engine management.

To use the utilities, the ibm-lh-client package is to be installed on your system. For more information, see Installing ibm-lh-client package

The ibm-lh-client supports the following utilities:

cert-mgmt

Add or remove presto engine connection certificates to ibm-lh-client truststore.

Syntax

Add a presto engine connection certificate:
./cert-mgmt --op=add --host=<host> --port=<port>
Remove a presto engine connection certificate:
./cert-mgmt --op=remove --host=<host> --port=<port>

For more information on how to use cert-mgmt, refer Setting up the ibm-lh command-line utility

presto-cli

Start an interactive session.

Syntax

Use the following command to start an interactive session:
bin/presto-cli --engine=<engine name> --catalog=tpch

For more information on how to use presto-cli, refer Connecting to a Presto server

presto-run

Run SQL in a noninteractive manner.

Syntax

Use the bin/presto-run utility to run SQL in a noninteractive manner:
bin/presto-run --engine=<engine-name> --catalog=tpch <<< "select * from tiny.customer limit 10;"
Run SQL from a file from your LH_SANDBOX_DIR mount.
bin/presto-run --engine=<engine-name> -f <path of sql file directory>

For more information on how to use presto-run, refer Connecting to a Presto server

python-run

It provides a way to run python scripts.

Syntax

Start an interactive python session.
bin/python-run --engine=<engine-name>
Note: The engine details are available as environment variables (ENG_HOST, ENG_PORT, ENG_USERNAME, ENG_PASSWORD). For example,os.environ['ENG_PASSWORD'] provides the saved password for the selected engine.
Run a python script from your LH_SANDBOX_DIR mount.
bin/python-run --engine=<lakehouse-engine-name> <python-script-in-sandbox>

For more information on how to use python-run, refer Running Python scripts by using ibm-lh-client

dev-sandbox

Provides a containerized environment with useful utilities and python modules to help explore the Lakehouse.

Syntax

Set the sandbox that starts an interactive bash shell from which you can run other commands:
bin/dev-sandbox --engine=<engine-name>

For more information on how to use dev-sandbox, refer Using the developer sandbox container

ibm-lh

It is a terminal-based interface that is designed to facilitate interaction with watsonx.data resources. For more information on how to use ibm-lh, refer ibm-lh commands and usage

connect-lh

Manage the connections for your watsonx.data engine. Use this command to add, remove, list, or show details of a presto engine connection.

Syntax

Add a Presto engine connection:
connect-lh --op=add \
--name=<alias> \
--host=<host> \
--port=<port> \
--username=<username> \
--password=<password>
Remove a Presto engine connection:
connect-lh --op=remove --name=<alias>
Show the connection details for a specific connection:
connect-lh --op=details --name=<alias>
List all configured engine connections:
connect-lh --op=list

For more information on how to use connect-lh refer Setting up the ibm-lh command-line utility

where:
name
The given name or alias to identify the connection.
host
IBM watsonx.data developer edition The hostname of the Presto server.

IBM watsonx.data stand-alone The exposed secure route for presto server. For more information, see Exposing secure route to Presto server.

IBM watsonx.data on IBM Cloud Pak for Data The exposed secure route for presto server. For more information, see Exposing secure route to Presto server.

IBM watsonx.data on IBM Cloud To get the hostname of the Presto server, from the web console, go to Infrastructure Manager, select the engine you want to connect to and copy the host. The copied host contains both the host and port details. Use the host details as the host name of the Presto server.

port
The port number of the Presto server.

IBM watsonx.data developer edition The default port is 8443.

IBM watsonx.data stand-alone The default port is 443.

IBM watsonx.data on Cloud Pak for Data The default port is 443.

IBM watsonx.data on IBM Cloud To get the port number of the Presto server, from the web console, go to Infrastructure Manager, select the engine you want to connect to and copy the host. The copied host contains both the host and port details. Use the port details as the port number of the Presto server.

username
The username for authentication.

IBM watsonx.data developer edition The default username is ibmlhadmin.

IBM watsonx.data stand-alone Username is the user created for stand-alone. The default username is admin. If IAM is enabled, the default user is cpadmin.

IBM watsonx.data on Cloud Pak for Data Username is the user created for Cloud Pak for Data. The default username is admin. If IAM is enabled, the default user is cpadmin.

IBM watsonx.data on IBM Cloud Username can either be ibmlhapikey or ibmlhtoken. For more information on how to use ibmlhapikey or ibmlhtoken, see Connect to Presto server.

password
The password for authentication.

IBM watsonx.data developer edition The default password is password.

IBM watsonx.data stand-alone To get the default password for default admin or cpadmin user, run the following command:
ibm-lakehouse-manage get-cpd-instance-details
IBM watsonx.data on Cloud Pak for Data, To get the default password for default admin or cpadmin user, run the following command:
cpd-cli manage get-cpd-instance-details \
--cpd_instance_ns=${PROJECT_CPD_INSTANCE} \
--get_admin_initial_credentials=true
Note: If the --password option is not specified, password is prompted.

IBM watsonx.data on IBM Cloud Password can either be apikey or apitoken. For more information see, Get api key and Get api token.