Orchestration CLI return codes

Orchestration CLI return codes

Orchestration CLI return-code management

When you run a Orchestration CLI command, the command line can show an outcome return code. To find the return code, perform the following action:
On Windows Operating systems:
echo %ERRORLEVEL%
On UNIX Operating systems:
echo $?

The Orchestration CLI command line provides the following return codes for the Orchestration CLI plan and model commands:

Table 1.
Return code Description
0 The model command completed successfully.

Run the add command for a simple job that will finish successfully:

  • Run this command: ocli model new job
  • Define the job as follows and save it:

$JOBS

WS_AGT_0#JOBDEF1

DOCOMMAND "dir"

STREAMLOGON Administrator

TASKTYPE WINDOWS

RECOVERY STOP

  • The system responds with this message: > AWSMRP001I You have successfully run the command "add" on the item "WS_AGT_0#JOBDEF1".
  • To see the return code, run this command: echo %ERRORLEVEL%

This returns code result 0

4 The model command generated a warning.

For example, try to add an existing item such as simple_job:

  • Run this command: ocli model add <file_path>\fileName.

where <file_path> is the path of the file that contains the definition of the simple_job.

The following error message is displayed:

  • The system responds with this message: > AWSMRP004W The item "WS_AGT_0#JS_RS_2115749800" already exists.

Do you want to replace the item (enter "y" for yes, "n" for no)?

  • To see the return code, run this command: echo %ERRORLEVEL%

This returns code result 4

8 The model command generated an error.

For example, define an item with an invalid syntax. For the purposes of this example, attempt to define a job without including "$JOBS" at the beginning og the definition.

  • The system responds with this message: > AWSMCG005E The definition does not specify the type of the item.
  • Run this command: echo %ERRORLEVEL%.

This returns code result 8

0 The plan command completed successfully.

For example, run a sj command on a valid Job Stream as follows :

  • Run te command: ocli plan sj WS_AGT_0#JS_ADJ_115749800

Workstation Job Stream SchedTime Job State Pr Start Elapse ReturnCode Dependencies

WS_AGT_0 #JS_ADJ_115749800 1139 02/17 **************************************** HOLD 10(02/18)

JS_RS_2115749800 HOLD 10

  • Run the command: echo %ERRORLEVEL%

This returns code result 0

8 The plan command generates an error.

For example, run an sbj command on a job that doesn't exist.

  • Run this command: ocli plan sbj WS_AGT_0#invalidJob
  • The system reponds with this message: > AWSMSL009E The criteria specified in the command does not match any item.
  • To see the return code, run this command: echo %ERRORLEVEL%

This returns code result 8