Information
Unsupported content This version of the documentation is no longer supported. However, the documentation is available for your convenience. You will not be able to leave comments.

BatchJob - createBatchJob_1


BatchJob - createBatchJob

Description :

This command creates a Batch Job with one member job. Use addMemberJobByJobKey to add more member jobs. Use removeMemberJobByJobKeyAndIndex to remove a job. If the Batch Job is to override targets, these must be added using Job : addTargetServer , or Job : addTargetGroup .

groupId is the ID of the intended parent group. memberKey is a handle to the initial member job.

bParallelExecution lets you specify that individual jobs within this Batch Job should run in parallel.

Return type : DBKey

Command Input :

Variable Name

Variable Type

Description

jobName

String

Name of the job to be created.

groupId

Integer

ID of the job group where this job is stored.

memberKey

DBKey

Handle to the initial member job.

bContinueOnError

Boolean

Continue on error.

bExecuteByStage

Boolean

Execute by Stage(true)/Server(false).

bOverrideTargets

Boolean

Override member targets.

bParallelExecution

Boolean

True to run the jobs within this Batch Job in parallel; false to run them sequentially.

Example

The following example shows how to create a new Batch Job with one member Snapshot Job.

Script


# Name of the new Batch Job.

BATCHJOB_NAME="batchjob1"

# Group in which the Batch Job is to be stored.

BATCHJOB_GROUP="/parent/group1"

BATCHJOB_GROUP_ID=`blcli JobGroup groupNameToId $BATCHJOB_GROUP`

# Name of the existing Snapshot Job.

JOB_NAME="job1"

# Job group in which the Snapshot Job is stored.

JOB_GROUP="/parent/group1"

# Get the Snapshot Job DBKey using the above information.

JOB_DBKEY=`blcli SnapshotJob getDBKeyByGroupAndName $JOB_GROUP $JOB_NAME`

# Continue on error. Set to true if you want the Batch Job to continue on error.

bContinueOnError="true"

# Execute by stage. Set to true to execute by stage and false to execute by server.

bExecuteByStage="true"

# Override targets. Set to true to override member job targets and false to use member targets.

bOverrideTargets="true"

# Parallel Execution. Set to true run the jobs jobs in parallel and false to run them sequentially.

bParallelExecution="true"

# Run the command with the above values to create the Batch Job.

BATCHJOB_DBKEY=`blcli BatchJob createBatchJob $BATCHJOB_NAME $BATCHJOB_GROUP_ID $JOB_DBKEY $bContinueOnError $bExecuteByStage $bOverrideTargets $bParallelExecution`

# Use the returned DBKey to add more jobs to the Batch Job.



 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC Server Automation Command Line Interface 8.5