How to Submit a Data Import Using the Command Line

You can use a command line to submit a Data Importer data import for processing instead of using the CA APM user interface. You can execute the command line from the Import Processor folder on the application server where the product is installed. You can also copy the Import Processor folder to another computer. The users of that computer can then execute the command line, also.
casm173
You can use a command line to submit a Data Importer data import for processing instead of using the CA APM user interface. You can execute the command line from the Import Processor folder on the application server where the product is installed. You can also copy the Import Processor folder to another computer. The users of that computer can then execute the command line, also.
The data import is submitted immediately and is executed by the Data Importer Engine with other import jobs from the CA APM user interface. You cannot schedule a data import to execute at a particular time using the command line. However, you can use a scheduler (such as the operating system scheduler) to specify dates and times to run the data import.
To submit a data import using the command line, perform these steps:
Example: Import New Hardware Devices
Sam, the CA APM system administrator at Document Management Company, has an existing data import that adds new hardware devices to the data repository. Sam wants to execute that data import daily. Sam also wants to verify the status of the submitted import job. However, he does not want to log in to the product to perform the import because he does not always perform other product functions on a daily basis. Sam uses the command line to submit the data import and then verify the status.
Review the Prerequisites
To ensure that you can successfully submit a data import using the command line, verify that you have completed the following prerequisites:
  1. Verify that Microsoft .NET Framework 4.0 is installed on the computer where you are executing the command line.
  2. Define a data import with all mappings and settings through the CA APM user interface.
  3. (Optional) If you change the Import Service URL, modify the ImportProcessor.exe.config file to reflect the new URL. You can locate the ImportProcessor.exe.config file in the Import Processor folder. Update the endpoint address value.
    Example: The following statements show an example of the endpoint address value that you modify to change the Import Service URL.
    <endpoint address="http://localhost/ImportService/ImportService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ImportService" contract="IImportService" name="BasicHttpBinding_ImportService" />
Display Version and Help
Specify the command line parameters to display the command line version and usage help.
Follow these steps:
  1. Log in to the application server where you installed CA APM or to a computer that has the Import Processor folder.
  2. Access the Import Processor folder.
    On the application server, the Import Processor folder is located in the CA APM installation path.
  3. Open a command prompt window and execute the following command:
    importerprocessor -H | -V
    • -H
      Displays the command line version number and usage help for the command line parameters.
    • -V
      Displays the command line version number.
Execute the Command Line
Specify the command line parameters to submit a data import.
Follow these steps:
  1. Log in to the application server where you installed CA APM or to a computer that has the Import Processor folder.
  2. Access the Import Processor folder.
    On the application server, the Import Processor folder is located in the CA APM installation path.
  3. Open a command prompt window and execute the following command:
    importerprocessor -usr "user_name" -pwd "password" -i "import_name" - df "data_file_absolute_path" -t "tenant_name" - ts -c
    • -usr
      Specifies the CA APM login user name.
    • -pwd
      Specifies the CA APM login password.
    • -i
      Specifies the name of the data import that was created previously through the CA APM user interface.
    • -df
      Specifies the absolute path of the data file that is associated with the data import. The Data Importer Engine uses this file to process the import.
    • -t
      (Required for multi-tenancy) Specifies the name of the tenant that is associated with the data import.
    • -ts
      (Optional) Specifies that the command line parameters are recorded in the Import Processor log file.
      The Import Processor log file is located in the Import Processor folder.
    • -c
      (Optional) Identifies whether the data import was provided with the product or was created by a user.
      Valid values: 1 (product provided) or 0 (created by a user)
      Default: 0
Retrieve the Import Job Status
Specify the command line parameters to verify the status of an import job.
Follow these steps:
  1. Log in to the application server where you installed CA APM or to a computer that has the Import Processor folder.
  2. Access the Import Processor folder.
    On the application server, the Import Processor folder is located in the CA APM installation path.
  3. Open a command prompt window and execute the following command:
    importerprocessor -usr "user_name" -pwd "password" -j "job_id" - ts
    • -usr
      Specifies the CA APM login user name.
    • -pwd
      Specifies the CA APM login password.
    • -j
      Specifies the import job ID.
    • -ts
      (Optional) Specifies that the command line parameters are recorded in the Import Processor log file.
      The Import Processor log file is located in the Import Processor folder.