Snapshot - getSnapshotKeyByJobRunId


Snapshot - getSnapshotKeyByJobRunId

Description :

This command returns a snapshot key (a job result key) based on a snapshot job runID, template name (not fully qualified), and server name.

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

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 by Job run Id.

Script





$TEMPLATE_NAME=basefiles

SNAP_JOB_KEY=`blcli SnapshotJob  [getDBKeyByGroupAndName|SnapshotJob - getDBKeyByGroupAndName] /Snapshots snapbasefiles`

#set the run Id

RUNID=12345

SNAPSHOT_KEY=`blcli Snapshot getSnapshotKeyByJobRunId $RUNID $TEMPLATE_NAME $MASTERSERVER `



 

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

TrueSight Server Automation Command Line Interface 21.02