REST API Reference > RunAJob utility > Using the RunAJob utility
  

Using the RunAJob utility

To use the RunAJob utility, type the RunAJob utility command followed by arguments.
The following string is the RunAJob utility command:
cli.bat runAJobCli
For each job, you must specify the task or taskflow to run. The syntax that you use to run a Data Integration taskflow is slightly different from the syntax you use to run a task.

Running tasks

The following command is an example of the syntax you can use to run a task using the task name and location to specify the task:
cli.bat runAJobCli -t <tasktype> -n <task name> -fp <folder path to the task>
For example, to run a Mass Ingestion file ingestion task, you might use the following command:
cli.bat runAJobCli -t MI_TASK -n mitask_Arch_2308 -fp myproject/folder1
The following command is an example of the syntax you can use to run a job using the federated task ID to specify the task:
cli.bat runAJobCli -t <tasktype> -fi <federated task ID>
For example, to run a Data Integration synchronization task using the federated task ID, you might use the following command:
cli.bat runAJobCli -t DSS -fi kvOF40yLXyUihm7wYYskmh

Running Data Integration taskflows

To run a taskflow using the RunAJob utility, the taskflow must be published and you must include values for Allowed Users and Allowed Groups in the taskflow designer. For more information, see Taskflows in the Data Integration help.
For each job, you must specify the taskflow to run using the taskflow's name.
To run a taskflow, use the following syntax:
cli.bat runAJobCli -t TASKFLOW -un <taskflow name>
For example, you might use the following command:
cli.bat runAJobCli -t TASKFLOW -un myPublishedTaskflow

Running Data Integration taskflows using parameter sets

You can use a parameter set to provide values for taskflow input parameters and run the taskflow using the RunAJob utility.
For more information about running taskflows with parameter sets using the RunAJob utility, see https://knowledge.informatica.com/s/article/DOC-19232. This article also includes a link to download the utility.
When you run a taskflow that uses a parameter set, type the RunAJob utility command followed by the -pun or --parameterSetUniqueName argument.
To run a taskflow using the RunAJob utility, the taskflow must be published and you must include values for Allowed Users and Allowed Groups in the taskflow designer. For more information, see Taskflows in the Data Integration help.
To run a taskflow that uses a parameter set, use one of the following syntaxes:
cli.bat runAJobCli -t TASKFLOW -un <taskflow_name> -fp <folder_path> -pun <unique_param_set_name>
cli.bat runAJobCli -t TASKFLOW -un <taskflow_name> -fp <folder_path> --parameterSetUniqueName <unique_param_set_name>
For example:
cli.bat runAJobCli -t TASKFLOW -un myTaskflow -fp myproject/folder1 -pun sampleParamSet
cli.bat runAJobCli -t TASKFLOW -un myTaskflow -fp myproject/folder1 --parameterSetUniqueName sampleParamSet
All taskflows run by using the /tf endpoint from the RunAJob utility.
Note: If you use the utility on Linux and you use another script or wrapper script to call cli.sh, be sure to comment the following line in the cli.sh file:
cd "$SCRIPT_DIR"
If you do not comment this line, you might receive the following error:
Could not find or load main class com.informatica.saas.utilities.plugins.RunAJobPlugin.

Task location

If you do not include a folder path or federated task ID in the command, the utility runs the task in the Default folder.
If the task is not located in the Default folder or you have multiple tasks with the same name located in different folders, be sure to include the folder path or federated task ID in the command.
To find the federated task ID, send a POST request using the REST API version 3 lookup resource.

RunAJob utility arguments

The RunAJob utility supports short and long options for arguments. Precede a short argument with a single hyphen. Precede a long argument with two hyphens.
You can use the following arguments in a RunAJob command:
Parameter
Short argument
Long argument
Description
username
-u
--user
Informatica Intelligent Cloud Services user name.
password
-p
--password
Informatica Intelligent Cloud Services password.
baseUrl
-bu
--baseUrl
Base URL. Default is https://dm-us.informaticacloud.com/ma.
Required.
taskId
-i
--taskId
Task ID.
Required when the command does not include the task name or federated task ID.
Not applicable for taskflows.
folderPath
-fp
--folderPath
Folder path to the location of the task such as myproject/folder1.
Required when the task isn't in the Default folder and the command doesn't include the federated task ID.
Not applicable for taskflows.
frsId
-fi
--frsId
Federated task ID, which is a global unique identifier.
Required when the task is not in the Default folder and the command does not include the folder path.
Not applicable for taskflows.
taskflowUniqueName
-un
--taskflowUniqueName
Taskflow unique name.
Required for Data Integration taskflows. Use instead of taskName.
taskName
-n
--taskName
Task name.
Not applicable for taskflows.
taskType
-t
--taskType
Task type. Required.
Use one of the following values:
  • - DMASK. Masking task.
  • - DRS. Replication task.
  • - DSS. Synchronization task.
  • - MTT. Mapping task.
  • - PCS. PowerCenter task.
  • - Workflow. Linear taskflow.
  • - MI_TASK. File ingestion task.
  • - TASKFLOW. Taskflow.
parameterSetUniqueName
-pun
--parameterSetUniqueName
Unique name of the parameter set. Can be used for taskflow.
parameterDir
-pd
--parameterDir
Parameter file directory. Include with parameterFile. Default is: <SecureAgentInstallDir>/apps/Data_Integration_Server/data/userparameters
parameterFile
-pf
--parameterFile
Parameter file. Can be used for mapping tasks.
waitFlag
-w
--waitFlag
Wait flag. Determines whether to wait for the job to complete or run the job in the background.
insecure
-k
--insecure
Insecure mode.
instanceName
-in
--instanceName
Custom name to be added to a taskflow name.

Job status codes

If a job is successful, the RunAJob utility returns a SUCCESS value of 0. If the job fails, the utility returns errors.
The utility can return the following status codes:
Code
Description
-1
Exception
0
Success
1
Warning
2
No wait
3
Failure
4
Timeout
5
Error
6
Running
7
Failure to start
If any required parameters are missing or are not valid in a command, an error message displays and the REST API call does not run.