AuditJob - createSnapshotToSnapshotAuditJob_1


AuditJob - createSnapshotToSnapshotAuditJob

Description :

This command creates an Audit Job that compares assets (that is, server objects) included in snapshots. A similar command, createSnapshotToSnapshotAuditJob , compares an entire snapshot to another entire snapshot.

You must provide an ID for the job group that will contain this Audit Job.

The masterSnapshotKey argument provides a handle to the snapshot results that should be the master. The targetSnapshotKey argument provides a handle to the snapshot results that are the target of the audit. The templateKey argument provides a handle to the template describing the assets to be audited. This command returns a handle to the newly created Audit Job. This handle can be used in other commands that need to reference the Audit Job you have created.

Return type : DBKey

Command Input :

Variable Name

Variable Type

Description

jobName

String

Name of the Audit Job to be created.

groupId

Integer

ID of the job group to which the Audit Job will be added.

templateKey

DBKey

Handle to the template describing the assets to be audited.

masterSnapshotKey

DBKey

Handle to the snapshot result that should be used as the master for the audit.

targetSnapshotKey

DBKey

Handle to the snapshot result that should be used as the target of the audit.

Example

The following example creates an Audit Job that compares assets included in snapshots. The example also shows how to obtain the various keys required in the final command.

Script

TEMPLATE_GROUP="/Template_Group"

TEMPLATE="Template_Name"

JOB_NAME="Job Name"

JOB_GROUP_ID=`blcli JobGroup groupNameToId "/BLCLI_Job_Group"`

TEMPLATE_KEY=`blcli Template getDBKeyByGroupAndName $TEMPLATE_GROUP $TEMPLATE`

MASTER_SNAPSHOT_KEY=`blcli  SnapshotJob getDBKeyByGroupAndName "/BLCLI_Job_Group" "BLCLI_Snapshot_Job"`

MASTER_SNAPSHOT_JOB_ID=`blcli Snapshot getSnapshotKeyByJobRunId $MASTER_SNAPSHOT_KEY "Template_Name" "Target_Name"`

TARGET_SNAPSHOT_KEY=`blcli  SnapshotJob getDBKeyByGroupAndName "/BLCLI_Job_Group" "BLCLI_Snapshot_Job"`

TARGET_SNAPSHOT_JOB_ID=`blcli Snapshot getSnapshotKeyByJobRunId $TARGET_SNAPSHOT_KEY "Template_Name" "Target_Name"`

SNAP_TO_SNAP_AUDIT_JOB=`blcli AuditJob createSnapshotToSnapshotAuditJob $JOB_NAME $JOB_GROUP_ID /
$TEMPLATE_KEY $MASTER_SNAPSHOT_JOB_ID $TARGET_SNAPSHOT_JOB_ID`

 

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

BMC Server Automation Command Line Interface 8.7