BatchJob - setRollingExecution
BatchJob - setRollingExecution
Description :
This command updates the Batch Job Rolling Execution option. The command sets the number of servers per run in the rolling execution option, and the overriden targets option. To turn on the rolling execution option the bOverrideTargets parameter passed to the blcli must be set to 'true'. In case 'false' will be passed to the blcli the targetsAmountPerRun option will be disabled even if a valid number was submitted. To disable the Rolling Execution Option you can pass either 'true' or 'false' to the bOverrideTargets and set targetsAmountPerRun to 0. The blcli returned value is the version updated Batch Job DBKey
Return type : DBKey
Command Input :
Variable Name | Variable Type | Description |
|---|---|---|
jobKey | DBKey | The handle to the Batch Job. |
bOverrideTargets | Boolean | Override member targets. |
targetsAmountPerRun | Integer | Enables you to run against no more than [n] servers at the same time. Spcifying '0' will disable the Rolling Execution option |
Example
The following example shows you how to set overriden flag and rolling servers amount.
Script
# Name of the existing Batch Job.
BATCHJOB_NAME="batchjob1"
# Job group in which the Batch Job is stored.
BATCHJOB_GROUP="/parent/group1"
# Get the Batch Job DBKey using the above information.
BATCHJOB_DBKEY=`blcli BatchJob getDBKeyByGroupAndName $BATCHJOB_GROUP $BATCHJOB_NAME`
# Override targets. Set to true to override member job targets and false to use member targets.
bOverrideTargets="true"
# Specify Rolling Execution Option. enables you to run against no more than [n] servers at the same time. if '0' is specified the options will be disabled.
targetsAmountPerRun="3"
#Set the Batch Job Override flag and the number of servers per rolling execution
BATCHJOB_DBKEY=`blcli BatchJob setRollingExecution $BATCHJOB_DBKEY $bOverrideTargets $targetsAmountPerRun`
# blcli will return the updated Batch Job DBKey