GenericObject - getBlObjectsByCondition
GenericObject - getBlObjectsByCondition
Description :
This command sets a simple property condition, then retrieves all class instances that match this condition.
The following arguments define the property condition -- fullyQualifiedName, propName, operator, and propValue.
For a list of the values you can use for operator, see the Condition : createPropertyConditionCLI command. This command returns a collection of class instances that match the specified property condition .
Return type : java.util.List
Command Input :
Variable Name | Variable Type | Description |
|---|---|---|
fullyQualifiedName | String | Fully qualified name of the model object. |
propName | String | Property name to be used in the smart group condition. |
operator | String | Operator string to be used in the smart group condition. |
propValue | String | Property value to be used in the smart group condition. |
index | Integer | A 0-based index that indicates the first instance to list. If you want the list to start with the first instance that this command finds, set index to 0; if you want the list to start with the second instance that this command finds, set index to 1, and so on. |
max_results | Integer | The maximum number of results to return. |
sortColumnName | String | Name of the sort column. |
ascending | Boolean | True to sort in ascending order; false to sort in descending order. |
Example
The following example shows you how to retrieve a list of servers whose NAME property is not set to null. The list can have a maximum of 5 results and is sorted on the DESCRIPTION column, in ascending order. Because index is set to 0, the list starts at the first matching server.
Script
GenericObject getBlObjectsByCondition "Class://SystemObject/Server" "NAME" "does not equal" "" 0 5 "DESCRIPTION" true