Information
Unsupported content This version of the documentation is no longer supported. However, the documentation is available for your convenience. You will not be able to leave comments.

ComplianceJob - addComponentToJobByJobDBKey


ComplianceJob - addComponentToJobByJobDBKey

Description :

This command adds a component to an existing Compliance Job.

The complianceKey argument is a DBKey referring to the Compliance Job 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 Compliance Job. Note that this handle is different than any existing handle to this Compliance Job. All older handles are invalid.

Return type : DBKey

Command Input :

Variable Name

Variable Type

Description

complianceKey

DBKey

Handle to the Compliance 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 Compliance Job.

Script


SERVER=nocdb1

TEMPLATE_GROUP=/noctemplates

TEMPLATE=dbconfig

# Job group in which the  Compliance Job is stored.

COMPLIANCE_JOB_GROUP=/nocsnaps

# Name of the existing Compliance Job.

COMPLIANCE_JOB_NAME=configsnap



SERVER_ID=`blcli Server getServerIdByName`

TEMPLATE_KEY=`blcli Template getDBKeyByGroupAndName $TEMPLATE_GROUP $TEMPLATE`

COMPLIANCE_JOB_KEY=`blcli ComplianceJob getDBKeyByGroupAndName $COMPLIANCE_JOB_GROUP $COMPLIANCE_JOB_NAME`

#  There is only one component on this server so use index 0.

COMPONENT_KEY=`blcli Component getComponentKeyByTemplateKeyAndServerId $TEMPLATE_KEY $SERVER_ID 0`



COMPLIANCE_JOB_KEY=`blcli addComponentToJobByJobDBKey $COMPLIANCE_JOB_KEY $COMPONENT_KEY`

 

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

BMC Server Automation Command Line Interface 8.3