Using conditional statements to query VCS objects
Some query commands include an option for conditional statements. Conditional statements take three forms:
Attribute=Value (the attribute equals the value)
Attribute!=Value (the attribute does not equal the value)
Attribute=~Value (the value is the prefix of the attribute, for example a query for the state of a resource = ~FAULTED returns all resources whose state begins with FAULTED.)
Multiple conditional statements can be used and imply AND logic.
You can only query attribute-value pairs that appear in the output of the command hagrp -display.
To display the list of service groups whose values match a conditional statement
- Type the following command:
# hagrp -list [conditional_statement]
If no conditional statement is specified, all service groups in the cluster are listed.
To display a list of resources whose values match a conditional statement
- Type the following command:
# hares -list [conditional_statement]
If no conditional statement is specified, all resources in the cluster are listed.
To display a list of agents whose values match a conditional statement
- Type the following command:
# haagent -list [conditional_statement]
If no conditional statement is specified, all agents in the cluster are listed.