SnapshotJob - addComponentToJobByJobDBKey
SnapshotJob - addComponentToJobByJobDBKey
Description :
This command adds a component to an existing Snapshot Job.
The snapshotKey argument is a DBKey referring to the snapshot to be modified. The componentKey argument is a DBKey referring to the component target to be added.
This command returns a handle to the updated Snapshot Job. Note that this handle is different than any existing handle to this Snapshot Job. All older handles are invalid.
Return type : DBKey
Command Input :
Variable Name | Variable Type | Description |
|---|---|---|
snapshotKey | DBKey | Handle to the Snapshot Job. |
componentKey | DBKey | Handle to the component to be added to the job. |
Example
The following example shows how to find a component key and add it to an existing Snapshot Job.
Script
SERVER=nocdb1
TEMPLATE_GROUP=/noctemplates
TEMPLATE=dbconfig
SNAP_JOB_GROUP=/nocsnaps
SNAP_JOB_NAME=configsnap
SERVER_ID=`blcli Server getServerIdByName`
TEMPLATE_KEY=`blcli Template getDBKeyByGroupAndName $TEMPLATE_GROUP $TEMPLATE`
SNAP_JOB_KEY=`blcli SnapshotJob getDBKeyByGroupAndName $SNAP_JOB_GROUP $SNAP_JOB_NAME`
# there is only one component on this server so use index 0
COMPONENT_KEY=`blcli Component getComponentKeyByTemplateKeyAndServerId $TEMPLATE_KEY $SERVER_ID 0`
SNAP_JOB_KEY=`blcli SnapshotJob addComponentToJobByJobDBKey $SNAP_JOB_KEY $COMPONENT_KEY`
TEMPLATE_GROUP=/noctemplates
TEMPLATE=dbconfig
SNAP_JOB_GROUP=/nocsnaps
SNAP_JOB_NAME=configsnap
SERVER_ID=`blcli Server getServerIdByName`
TEMPLATE_KEY=`blcli Template getDBKeyByGroupAndName $TEMPLATE_GROUP $TEMPLATE`
SNAP_JOB_KEY=`blcli SnapshotJob getDBKeyByGroupAndName $SNAP_JOB_GROUP $SNAP_JOB_NAME`
# there is only one component on this server so use index 0
COMPONENT_KEY=`blcli Component getComponentKeyByTemplateKeyAndServerId $TEMPLATE_KEY $SERVER_ID 0`
SNAP_JOB_KEY=`blcli SnapshotJob addComponentToJobByJobDBKey $SNAP_JOB_KEY $COMPONENT_KEY`
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*