AuditJob - createComponentToComponentAuditJob_1
AuditJob - createComponentToComponentAuditJob
Description :
This command creates an Audit Job based on components. It compares a component on a live server to all instances of a component on another live server. A similar command, createComponentToComponentAuditJob , compares a component to a particular component on a live server.
You must provide an ID for the job group that will contain this Audit Job.
The masterComponentKey argument provides a handle for the component that functions as the master. The templateKey argument provides a handle identifying the template used to discover components on a server. To obtain these handles, use the command Template getDBKeyByGroupAndName .
You must also provide the name of the server 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 | String | ID of the job group to which the Audit Job will be added. |
masterComponentKey | DBKey | Handle to the component to be used as the master for the audit. |
templateKey | DBKey | Handle to the template used to discover components that are the target of the audit. |
serverName | String | Name of the server to be audited. |
Example
The following example creates a live-to-live, component-based Audit Job. A server group is also added as a target.
For this example, a component template must already exist, and a component must have already been discovered on the target server.
Script
SERVER_ID=`blcli Server getServerIdByName $TARGETSERVER`
JOB_GROUP_ID=`blcli JobGroup groupNameToId /Audits`
TEMPLATE_KEY=`blcli Template getDBKeyByGroupAndName /filesystem basefiles`
COMPONENT_KEY=`blcli Component getComponentKeyByTemplateKeyAndServerId $TEMPLATE_KEY $SERVER_ID`
JOB_KEY=`blcli AuditJob createComponentToComponentAuditJob basefileaudit $JOB_GROUP_ID $COMPONENT_KEY $TEMPLATE_KEY $TARGETSERVER`
JOB_KEY=`blcli Job addTargetGroup $JOB_KEY $TARGETGROUP`