Job - listTargets


Job - listTargets

Description :

This command returns a list of target names (separated by commas) that are targets of a specific Job. blcli Job listTargets $JOB_KEY targetTypes

The argument targetTypes can have following values. Separate multiple targetTypes by comma:

  • Servers
  • Components

The argument JOB_KEY is a handle to the job being queried. To find the jobKey for a specific job type, use the getDBKeyByGroupAndName for that particular job type. Below example is for AuditJob. AuditJob getDBKeyByGroupAndName command.

Return type : java.util.List

Command Input :

Variable Name

Variable Type

Description

jobKey

DBKey

Handle to the job.

targetTypes

String

The desired target type(s).

Example

The following example shows how to use this blcli to get the targets of a job.

Note: This blcli does not distinguish between Enrolled, Non-Enrolled, decomissioned servers when you query by using option "Servers". Use listTargetServers blcli for the same.

Script

JOB_KEY=`blcli AuditJob getDBKeyByGroupAndName /group1 auditJob1`

blcli Job listTargets $JOB_KEY Components

blcli Job listTargets $JOB_KEY Servers,Components

 

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

BMC Server Automation Command Line Interface 8.7