Utility details of ibm-lh-client package

This topic provides details of the ibm-lh-client package utilities.

watsonx.data Developer edition

watsonx.data on IBM Software Hub

watsonx.data on IBM Cloud®

The ibm-lh-client package contains the following utilities, which can be used to perform different tasks in watsonx.data.
Important: To use these utilities, make sure you have the ibm-lh-client package installed. Run the utilities from the bin folder within the package installation path.

cert-mgmt

Use the cert-mgmt utility to add or remove SSL certificates in the ibm-lh-client truststore to establish connection with the Presto engine.

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>

See table for more details about the parameters.

connect-lh

Use the connect-lh utility to add or remove a Presto engine connection of a watsonx.data instance. All engine information will be stored encrypted. It can also be used to list or show details of a Presto engine connection.

Syntax

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

See table for more details about the parameters.

ibm-lh

You can use the ibm-lh utility to perform the following tasks in watsonx.data:

- Configure connectivity to watsonx.data API endpoints

- Work with the engines. For example, add, remove, list, and so on.

- Work with the databases

- Work with the buckets

- Ingest data

- Maintain tables

- Extract query event log information

Different commands in the ibm-lh utility facilitate these tasks. For information about the components, see ibm-lh commands and usage.

presto-cli

Use the presto-cli utility to connect to watsonx.data engines using Presto and run queries within the Presto CLI.

Syntax

You can use the presto-cli utility to run SQL queries:
bin/presto-cli --engine=<engine name> --catalog=<catalog_name> <<< "select * from tiny.customer limit 10;"

For more information on how to use presto-cli, refer Running SQL queries by using ibm-lh-client.

presto-run

Use the presto-run utility to manage multiple query languages and interfaces on databases and storage by connecting to Presto using its CLI.

Syntax

You can run an SQL query or SQL files using the presto-run utility:
bin/presto-run --engine=<engine-name> --catalog=<catalog_name> <<< "select * from tiny.customer limit 10;"

For more information on how to use presto-run, refer Running SQL queries by using ibm-lh-client.

python-run

Run Python scripts or files using python-run utility.

Syntax

Start a Python session by running the following command:
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.

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 watsonx.data.

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 Python scripts using sandbox directory.

Description of parameters
Parameter Description
host
  • watsonx.data Developer edition for presto-cli - The hostname of the Presto server in watsonx.data Developer edition. From Infrastructure Manager, click the engine you want to connect 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.
  • watsonx.data Developer edition for ibm-lh - The hostname from the URL of watsonx.data Developer edition.
  • watsonx.data software for presto-cli - The exposed secure route for the Presto server in watsonx.data software. For more information about exposing secure route, see Exposing secure route to Presto server or from Infrastructure Manager, click the engine you want to connect 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.
  • watsonx.data software for ibm-lh - The secure route for the Presto server in watsonx.data software. For example: Copy the host from the URL of the watsonx.data instance.
  • watsonx.data on IBM Cloud for presto-cli - The hostname of the Presto server in watsonx.data on IBM Cloud. From Infrastructure Manager, click the engine you want to connect 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.
  • watsonx.data on IBM Cloud for ibm-lh - The hostname of the cloud server in watsonx.data instance on IBM Cloud. For example : us-south.lakehouse.dev.cloud.ibm.com.
port
  • watsonx.data Developer edition - The default port is 9443.
  • watsonx.data software - The default port is 443.
  • watsonx.data on IBM Cloud for presto-cli - The port number of the Presto server from the web console in watsonx.data on IBM cloud. From Infrastructure Manager, select the engine you want to connect 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.
  • watsonx.data on IBM Cloud for ibm-lh - The default port is 443.
username
  • watsonx.data Developer edition - The default username for authentication is ibmlhadmin.
  • watsonx.data software - Username is the user created for watsonx.data software. The default username is admin. If IAM is enabled, the default username is cpadmin.
  • watsonx.data on IBM Cloud - Username can either be ibmlhapikey or ibmlhtoken in watsonx.data on IBM Cloud. For more information on how to use the username, see Connect to Presto server.
password
  • watsonx.data Developer edition - The default password for authentication is password.
  • watsonx.data software - To get the default password for admin or cpadmin user in watsonx.data software, run the following command:
    cpd-cli manage get-cpd-instance-details \
    --cpd_instance_ns=${PROJECT_CPD_INST_OPERANDS} \
    --get_admin_initial_credentials=true
    Note: If the --password option is not specified, password is prompted.
  • watsonx.data on IBM Cloud - Password can either be apikey or apitoken in watsonx.data on IBM cloud. For more information see, Get API key and Get API token.