Skip to main content

We've Moved!

Product Documentation has moved to docs.hitachivantara.com
Hitachi Vantara Knowledge

CLI reference

Hitachi Content Intelligence includes these command-line interfaces (CLIs):

  • An administrative CLI for managing the system. This interface allows you to perform all tasks relating to system setup, configuration, and indexing data (for example, creating and running workflows). Everything that you can do in the Admin App or REST API you can also do with the admin CLI.
  • A search CLI for searching for files. Everything that you can do in the Search App you can also do with the search CLI.
  • A workflow CLI for creating and running workflows. Everything that you can do in the Workflow Designer you can also do with the workflow CLI.
  • A CLI for monitoring other systems. Everything that you can do in the Monitor App you can also do with the monitor CLI.

Accessing the CLI tools on a system instance

You can access the CLI tools from any instance. To do this:

Procedure

  1. Log in or SSH into a system instance.

  2. Navigate to the CLI tool:

    cd <installation-folder>/cli/
  3. Navigate to the folder for the CLI tool you want. For example:

    cd admin

Accessing the CLI tools from your computer

You can install your system's CLI tools on your Windows or Linux computer. To do this, you must have version 1.8 of the Java Runtime Environment (JRE) installed.

Your system's CLI tools are distributed in .tgz files along with the software installation package.

HCI-Administration-CLI-<version>.tgz
HCI-Search-CLI-<version>.tgz
HCI-Workflow-CLI-<version>.tgz

The HCM tools are distributed in a .tgz file along with the HCM installation package:

HCI-Monitor-CLI-<version>.tgz

To install a CLI tool:

Procedure

  1. Store the .tgz file in a directory on your computer.

  2. Unpack the file:

    • On Linux:
      tar zxvf filename
    • On Windows, use an archive extraction tool such as 7-zip that can extract .tgz files.

Syntax

The CLI tools have this syntax:

<tool-name> [options] [command] [command-specific-options]
Options
-c, --command <command|category>

Specifies the command you want to run. When used with the --help option, displays information about the specified command.

You can also use this option to specify a category of commands when using the --help option. Doing this displays information about all commands within the specified category.

-d, --model-definition <name>

Returns information about the specified request model. See Viewing request models.

--debug

Includes verbose debug output for troubleshooting purposes.

-h, --help <all>

Displays help information. If you specify the all argument, displays information an all commands. If you specify the -c option, displays information about commands in the specified category.

-k, --check-ssl-cert <true|false>

Whether to enable SSL security checking. When false, insecure connections are allowed.

-m, --model-schema <ModelName>

Returns the JSON-formatted schema for the specified request model. See Viewing request models.

-p, --password <password>

Password for the specified user account.

--port

The port for the system application that supports the CLI tool.

-r, --realm <realm>

Security realm where your user account is defined. For more information, see your system administrator to view identity providers.

-s, --server <server>

The hostname or IP address of a system instance.

-u, --username <username> 

Username for an account that has permission to access Hitachi Content Intelligence.

-V, --version

Displays the CLI version.

TipYou can use the CLI .conf file to specify defaults for some of these options. For information, see Editing configuration preferences.

Viewing available commands

To view all available commands, run:

<cli-tool-name> --help all

To view all command categories, run:

<cli-tool-name> --help

To view all commands within a category, run:

<cli-tool-name> --help -c <category>

For example:

workflowcli --help -c workflows

To view all information about a single command, run:

<cli-tool-name> --help -c <command>

For example:

workflowcli --help -c listWorkflows

Viewing request models

Some commands need you to include a JSON-formatted request body along with the command. The command's request model determines how you need to format the request body.

The help command for an individual command indicates what request model it needs.

For example, this help command output indicates that a command to create a content class needs a ContentClassModel request:

# ./workflowcli -c createContentClass -h
usage: createContentClass
Name:
createContentClass
Description:Creates a new content class
Usage:
workflowcli -c createContentClass <options>
Options:--content-class-model <ContentClassModel>
File containing JSON text representing a ContentClassModel for the command createContentClass. 
Viewing request model information

To view detailed information about the contents of a request model, run:

<cli-tool-name> -d <ModelName>

For example:

workflowcli -d ContentClassModel
Viewing request model formatting

To view the JSON format for the request model, run:

<cli-tool-name> -m <ModelName>

Editing configuration preferences

You can use the CLI tool's .conf file to specify settings to use every time you run a CLI command.

The CLI configuration file has this format:

{
  "defaultSettings": {
    "checkSSLCert": "[false|true]",(optional)
    "server": "<hostname>",(optional)
    "realm": "[local|<security-realm-name>]",(optional)
    "username": "<your-username>",(optional)
    "password": "<your-password>" (optional)
  }
}

For example, with the following configuration, all commands:

  • Are run against the system.example.com system
  • Verify the SSL certificate for the system before connecting
  • Uses the exampleUsersEast security realm to authenticate the specified username and password
{
  "defaultSettings": {
    "checkSSLCert": "true",
    "server": "system.example.com",
    "realm": "exampleUsersEast"
  }
}
File locations

You can configure a CLI preferences file in two ways:

  • By editing the existing .conf file in the CLI installation folder.
  • By creating a configure file in a folder called .hci in your home directory:
    • On Linux:
      ~/.hci/admincli.conf
    • On Windows:
      %UserProfile%\.hci\admincli.conf
Calculating option values

These criteria determine what values are used when you run a CLI command:

  • Options specified explicitly in a CLI command

    overwrite

  • Options specified in the user's home folder .conf file

    overwrite

  • Options specified in the CLI installation folder .conf file

System error responses

If a CLI request reaches the system and the system returns an error, the CLI response contains:

  • An HTTP status code
  • Conditionally, a product-specific error code
  • A JSON-formatted error response body
HTTP status codes

This table describes the typical reasons why these HTTP status codes are returned.

Status codeMeaningDescription
400Bad Request

The request body contains one or more of these:

  • An entry that isn't valid
  • A value for an entry that isn't valid
  • Incorrectly formatted JSON

If the request includes a UUID, the UUID might be incorrectly formatted.

401UnauthorizedThe provided credentials are incorrect.
403ForbiddenYou do not have permission to perform the request.
404No FoundThe resource you are trying to retrieve or edit cannot be found.
409ConflictThe resource you are trying to create already exists.
500Internal Server ErrorThe system experienced an error.
599Network Connection Timeout ErrorThe CLI request timed out while trying to connect to the system or one of its instances.
Product-specific error codes

Some CLI requests return product-specific error codes in addition to an HTTP status code. These error codes are listed in the errorCodes field in the JSON response body. This table describes these error codes.

Status codeDescription
4000SSL certificate not trusted.
JSON response body

Error response bodies have this format:

{
    "statusCode": <HTTP-status-code>,
    "errorCode": <product-specific-error-code>,
    "errorMessage": <message>,
    "errorProperties": [
        {
            "name": <error-property>,
            "message": <error-property-message>
        }
    ]
}				

 

  • Was this article helpful?