Snapshot - getSnapshotKeyByJobKeyAndRunId
Snapshot - getSnapshotKeyByJobKeyAndRunId
Description :
This command is deprecated. Use getSnapshotKeyByJobRunId instead.
This command returns a snapshot key (a job result key) based on a job key, runID, template name (not fully qualified), and server name.
You can get a job key using the command SnapshotJob getDBKeyByGroupAndName .
To get the runId, first get the job run key. The JobRun : findAllRunKeysByJobKey command has an example of how to do this. Once you have the job run key, you can use the JobRun : jobRunKeyToJobRunId command to get the runId.
You need a snapshot key for commands such as AuditJob createSnapshotToComponentAuditJob or BlPackage createPackageFromSnapshot . This command returns a snapshot key.
Return type : com.bladelogic.om.infra.model.base.keys.SJobResultKey
Command Input :
Variable Name | Variable Type | Description |
|---|---|---|
jobKey | com.bladelogic.om.infra.model.base.keys.SJobKey | Key of the Snapshot Job. |
runId | Integer | ID of a particular Snapshot Job run. |
templateName | String | Name of the template of interest. |
targetServerName | String | Name of the server of interest. |
Example
The following example shows how to find a snapshot key for the first run of a Snapshot Job.
Script
$TEMPLATE_NAME=basefiles
SNAP_JOB_KEY=`blcli SnapshotJob [getDBKeyByGroupAndName|SnapshotJob - getDBKeyByGroupAndName] /Snapshots snapbasefiles`
#use the first run
RUNID=1
SNAPSHOT_KEY=`blcli Snapshot getSnapshotKeyByJobKeyAndRunId $SNAP_JOB_KEY $RUNID $TEMPLATE_NAME $MASTERSERVER `