insertjob Command - Insert a Job into an Active Application Generation

You can insert a job into an active Application generation by issuing the INSERTJOB command. The inserted job runs immediately unless you define predecessor, time, variable, or resource dependencies, or insert the job on hold or on request.
cwad121
HID_insert_job_cli
You can insert a job into an active Application generation by issuing the INSERTJOB command. The inserted job runs immediately unless you define predecessor, time, variable, or resource dependencies, or insert the job on hold or on request.
 
  • You cannot insert a job into an Application that is complete.
  • This command is supported only for Windows and UNIX jobs.
This command has the following format:
insertjob jobname("
jobname
") qualifier("
job_qualifier"
) application("
application
.
generation
") jobtype("
jobtype
") reason("reason") jobparameters("
param1
(
value
) ...")
  • jobname("
    jobname
    ")
    Specifies the name of the job.
  • qualifier("
    job_qualifier"
    )
    Specifies the qualifier of the job.
  • application("
    application
    .
    generation
    ")
    Specifies the name of the Application generation that you want to insert the job into.
    • application
      Specifies the Application name.
    • generation
      Specifies the Application generation number.
      Example:
       application("appl.1")
  • jobtype("
    jobtype
    ")
    Specifies the type of job to be inserted. The following job types are supported:
    • NT—Windows
    • UNIX—UNIX
  • reason("
    reason
    ")
    (Optional) Specifies the reason for issuing the command.
     If the Require reason for job commands option is selected in the Application properties, the Reason parameter is required.
  • jobparameters("
    param1
    (
    value
    ) ...")
    Specifies the job parameters that apply to the job that you want to insert.
    Example:
    jobparameters("Rununit(AGENT) Command(\"C:\\cygwin\\bin\\sleep.exe\") Args(2) USER(root) Tag(\"tag value here \")")
    • Provide all mandatory parameters for the job type. Otherwise, the job will not be inserted and an error message will appear.
    • Values that contain special characters such as quotation marks (") must be escaped using a backslash (): Tag(\"tag value here\").
    • To get the list of job parameters, do one of the following tasks:
      • Insert the job with the same parameters in the Monitor perspective. When inserting a job, CA WA Desktop Client forms a message that is based on the user inputs and sends it to the server. From the console, you can copy the remaining parameters after the Type parameter and paste it as the value of this operand.
Example: Insert a UNIX Job into an Active Application
 The following example inserts a UNIX job UNIX_TEST_JOB into the current generation of Application VERIFY. The job runs a command on the default agent under the root user and has resource and variable dependencies. When the job completes, it sends an email notification. The server resubmits the job automatically once after 1 minute if the job returns a FAIL state.
insertjob jobname("UNIX_TEST_JOB") application("VERIFY.0") jobtype("UNIX") jobparameters("Rununit(AGENT) Command(/bin/sleep) Args(200) USER(root) Relcount(0) Retry(RetryCount(1) RetryInterval(1) RetryCondition(1)) Tag(WOB.sched) NotifyemailNum(1) Notifyemail(Notify1(Monitorstates(COMPLETE) Mailaddresslist(\"[email protected]ca.com\") EmailText(APPEND_TO_GLOBAL) EmailTextUseFlag(APPEND_TO_GLOBAL) Attachspoolfile(Y))) Resourcedependencies(Resources((RES,1)),Resourceabsorb(false),Resourcesacquiringpriority(0)) VariableDependencies(Expression1(Name(SERVERDBTYPE) Context(DEFAULT) Operator(NOT_EQUAL_TO) Value(ddd)) LogicOperation(AND))")
Examples: Insert a Windows Job into an Active Application
 The following example inserts a Windows job named windows1 into generation 4 of Application insert. The job runs a command on the AGENTR113SP4 agent.
insertjob jobname("windows1") application("insert.4") jobtype("NT") jobparameters("Rununit(AGENTR113SP4) Command(\"C:\\cygwin\\bin\\sleep.exe\") Args(s) Relcount(0) Retry(RetryCount(1) RetryInterval(1) RetryCondition())")
The following example inserts a Windows job WIN_JOB_1 into the current generation of Application VERIFY. The job runs on the AGENT_WIN agent.
insertjob jobname("WIN_JOB_1") application("VERIFY.0") jobtype("NT") jobparameters("Rununit(AGENT_WIN) Command(\"C:\\cygwin\\bin\\sleep.exe\") Args(200)")