Job - getTargets

Job - getTargets

Description :

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

This command is deprecated.  Use the listTargets instead.

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 getTargetServers blcli for the same.

Script

JOB_KEY=`blcli AuditJob getDBKeyByGroupAndName /group1 auditJob1` 

blcli Job getTargets $JOB_KEY Components 

blcli Job getTargets $JOB_KEY Servers,Components 



Was this page helpful? Yes No Submitting... Thank you

Comments