Develop > HPE Codar CLI set up

Codar CLI set up

HCM ARA provides a command line interface (CLI) for accessing all HCM ARA REST end points. You can perform all HCM ARA specific functionality from your local machine using the CLI.

Use the --help option to view a list of available commands, and to read documentation about the functionality and options available for each command.

Set up your local Windows machine to use Codar CLI

The HCM ARA CLI is provided in an executable .jar file. To access the CLI remotely from your Windows system, perform the following steps to copy the CLI files from the HCM ARA installation on to your local Windows system:

  1. Create a working directory on your local Windows system.
  2. Make sure java is installed and the JAVA_HOME environment variable is set.
  3. Copy the following files from the Tools\CodarCLI directory of the HCM ARA installation (C:\Program Files\Hewlett-Packard\Codar\Tools\CodarCLI) to the working directory:

    1. codar-clis.jar – Standalone java executable .jar file with all CLI specific java classes and required dependencies
    2. codarexec.bat – Batch file to use to execute the above .jar file by starting a JVM process
    3. env.bat – Configuration for CLI
    4. log4j.properties – Logging information
    Note: All of the above files must be in the same working directory.
  4. Copy the cliforcodar.properties file to the user home directory. Edit the URL and credentials used to access HCM ARA.

    Note: You must store the password in the clidorcodar.properties file in an encrypted format. Refer to topic 'Encrypt password' in the 'Configuration Guide' to know how to encrypt the password.
  5. Run the codarexec.bat batch file to see the list of available commands.

Set up your local Linux machine to use Codar CLI

The HCM ARA CLI is provided in an executable .jar file. To access the CLI remotely from your Linux system, perform the following steps as a root user to copy the CLI files from the HCM ARA installation on to your local Linux system:

  1. Create a working directory on your local Linux system.
  2. Make sure java is installed and the JAVA_HOME environment variable is set.
  3. Copy the following files from the Tools\CodarCLI directory of the HCM ARA installation (\Hewlett-Packard\Codar\Tools\CodarCLI) to the working directory:

    1. codar-clis.jar – Standalone java executable .jar file with all CLI specific java classes and required dependencies
    2. codarexec.sh – Batch file to use to execute the above .jar file by starting a JVM process
    3. log4j.properties – Logging information
  4. Copy the cliforcodar.properties file to the user home directory. Edit the URL and credentials used to access HCM ARA.

    Note: You must store the password in the clidorcodar.properties file in an encrypted format. Refer to topic 'Encrypt password' in the 'Configuration Guide' to know how to encrypt the password.
  5. Run the codarexec.sh file to see the list of available commands.

    Note: Verify this configuration using the root user. If you are not a root user, then the necessary permission must be provided for all files for that user

If you are not a root user, perform the following steps to access the CLI remotely from your Linux system:

  1. Open a shell prompt.
  2. If needed, perform the following steps to create a new root user:

    1. Type the su- command and enter the root password.
    2. Type the useradd command followed by a space and the user name for the new user. For example, useradd newuser1. This creates a directory in the new user home directory. For example, home/newuser1.
  3. Copy the following files from the Tools\CodarCLI directory of the HCM ARA installation (\Hewlett-Packard\Codar\Tools\CodarCLI) to the home directory:

    1. codar-clis.jar
    2. codarexec.sh
    3. log4j.properties
    4. cliforcodar.properties
  4. Run the codarexec.sh file to see the list of available commands.