CLI
The system includes an administrative CLI for managing the system. This interface allows you to perform all tasks relating to system setup and configuration. Any administrative activity that you can perform in the Administration App or REST API can be performed through the CLI.
You can access the CLI tool from any instance. To do this:
1.Log or SSH into a system instance.
2.Navigate to the CLI tool directory:
cd <installation-directory>/cli/admin
You can install the CLI tool on your Windows or Linux computer. To do this, you must have version 1.8 of the Java Runtime Environment (JRE) installed.
The CLI tool is distributed in a .tgz file along with the software installation package.
To install the CLI tool:
1.Store the .tgz file in a directory on your computer.
2.To unpack the file:
oOn Linux:
tar zxvf filename
oOn Windows, use an archive extraction tool such as 7-zip that can extract .tgz files.
The CLI tool has this syntax:
admincli [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.
-h, --help <all>
Displays help information. If you specify 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.
-r, --realm <realm>
Security realm where your user account is defined. For information, see Adding 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 system.
-V, --version
Displays the CLI version.
Tip: You can use the admincli.conf file to specify defaults for some of these options. For information, see Editing configuration preferences. |
•To view all available commands, run:
admincli --help all
•To view all command categories, run:
admincli --help
•To view all commands within a category, run:
admincli --help -c <category>
•To view all information about a single command, run:
admincli --help -c <command>
Some commands require that you 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 requires. For example, this help command output indicates that a command to create a content class requires a ContentClassModel request:
# ./admincli -c createContentClass -h
usage: createContentClass
Name:
createContentClass
Description:
Creates a new content class
Usage:
admincli -c createContentClass <options>
Options:
--content-class-model <ContentClassModel>
File containing JSON text representing a ContentClassModel for the command createContentClass.
Viewing request model informationTo view detailed information about the contents of a request model, run:
admincli -d <ModelName>
Viewing request model formattingTo view the JSON format for the request model, run:
admincli -m <ModelName>
You can use the admincli.conf file to specify settings to use every time you run an admincli 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
•Check 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 locationsYou can configure a CLI preferences file in two ways:
•By editing the existing .conf file in the CLI installation directory
•By creating a configure file in a directory called .hci in your home directory:
oOn Linux:
~/.hci/admincli.conf
oOn Windows:
%UserProfile%\.hci\admincli.conf
Calculating option valuesThese 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 directory .conf file
overwrite
•Options specified in the CLI installation directory .conf file
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 codesThis table describes the typical reasons why these HTTP status codes are returned.
Status code | Description |
---|---|
400 (Bad Request) |
The request body contains one or more of these: •An invalid entry •An invalid value for an entry •Invalidly formatted JSON If the request includes a UUID, the UUID may be invalidly formatted. |
401 (Unauthorized) |
The provided credentials are invalid. |
403 (Forbidden) |
You do not have permission to perform the request. |
404 (File not found) |
The resource you are trying to retrieve or edit cannot be found. |
409 (Conflict) |
The resource you are trying to create already exists. |
500 (Server Error) |
The system experienced an error. |
599 (Network Connection Timeout Error) |
The CLI request timed out while attempting to connect to the system or one of its instances. |
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.
Error code |
Description |
---|---|
4000 |
SSL certificate not trusted. |
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> } ] }
Trademarks, Legal disclaimer, Third-party software in this documentation
© 2017 Hitachi Vantara Corporation. All rights reserved.