Go to the source code of this file.
|
enum expression_type | find_expression_type (xmlNode *expr) |
|
gboolean | pe_evaluate_rules (xmlNode *ruleset, GHashTable *node_hash, crm_time_t *now, crm_time_t *next_change) |
| Evaluate any rules contained by given XML element. More...
|
|
gboolean | pe_test_rule (xmlNode *rule, GHashTable *node_hash, enum rsc_role_e role, crm_time_t *now, crm_time_t *next_change, pe_match_data_t *match_data) |
|
gboolean | pe_test_expression (xmlNode *expr, GHashTable *node_hash, enum rsc_role_e role, crm_time_t *now, crm_time_t *next_change, pe_match_data_t *match_data) |
| Evaluate one rule subelement (pass/fail) More...
|
|
void | pe_eval_nvpairs (xmlNode *top, const xmlNode *xml_obj, const char *set_name, pe_rule_eval_data_t *rule_data, GHashTable *hash, const char *always_first, gboolean overwrite, crm_time_t *next_change) |
|
void | pe_unpack_nvpairs (xmlNode *top, xmlNode *xml_obj, const char *set_name, GHashTable *node_hash, GHashTable *hash, const char *always_first, gboolean overwrite, crm_time_t *now, crm_time_t *next_change) |
| Extract nvpair blocks contained by an XML element into a hash table. More...
|
|
char * | pe_expand_re_matches (const char *string, pe_re_match_data_t *match_data) |
|
gboolean | pe_eval_rules (xmlNode *ruleset, pe_rule_eval_data_t *rule_data, crm_time_t *next_change) |
|
gboolean | pe_eval_expr (xmlNode *rule, pe_rule_eval_data_t *rule_data, crm_time_t *next_change) |
|
gboolean | pe_eval_subexpr (xmlNode *expr, pe_rule_eval_data_t *rule_data, crm_time_t *next_change) |
|
◆ expression_type
Enumerator |
---|
not_expr | |
nested_rule | |
attr_expr | |
loc_expr | |
role_expr | |
time_expr | |
version_expr | - Deprecated:
- Do not use (will be removed in a future release)
|
rsc_expr | |
op_expr | |
Definition at line 22 of file rules.h.
◆ find_expression_type()
◆ pe_eval_expr()
◆ pe_eval_nvpairs()
void pe_eval_nvpairs |
( |
xmlNode * |
top, |
|
|
const xmlNode * |
xml_obj, |
|
|
const char * |
set_name, |
|
|
pe_rule_eval_data_t * |
rule_data, |
|
|
GHashTable * |
hash, |
|
|
const char * |
always_first, |
|
|
gboolean |
overwrite, |
|
|
crm_time_t * |
next_change |
|
) |
| |
◆ pe_eval_rules()
◆ pe_eval_subexpr()
◆ pe_evaluate_rules()
gboolean pe_evaluate_rules |
( |
xmlNode * |
ruleset, |
|
|
GHashTable * |
node_hash, |
|
|
crm_time_t * |
now, |
|
|
crm_time_t * |
next_change |
|
) |
| |
Evaluate any rules contained by given XML element.
- Parameters
-
[in] | xml | XML element to check for rules |
[in] | node_hash | Node attributes to use when evaluating expressions |
[in] | now | Time to use when evaluating expressions |
[out] | next_change | If not NULL, set to when evaluation will change |
- Returns
- TRUE if no rules, or any of rules present is in effect, else FALSE
Definition at line 39 of file rules.c.
◆ pe_expand_re_matches()
◆ pe_test_expression()
Evaluate one rule subelement (pass/fail)
A rule element may contain another rule, a node attribute expression, or a date expression. Given any one of those, evaluate it and return whether it passed.
- Parameters
-
[in] | expr | Rule subelement XML |
[in] | node_hash | Node attributes to use when evaluating expression |
[in] | role | Resource role to use when evaluating expression |
[in] | now | Time to use when evaluating expression |
[out] | next_change | If not NULL, set to when evaluation will change |
[in] | match_data | If not NULL, resource back-references and params |
- Returns
- TRUE if expression is in effect under given conditions, else FALSE
Definition at line 88 of file rules.c.
◆ pe_test_rule()
◆ pe_unpack_nvpairs()
void pe_unpack_nvpairs |
( |
xmlNode * |
top, |
|
|
xmlNode * |
xml_obj, |
|
|
const char * |
set_name, |
|
|
GHashTable * |
node_hash, |
|
|
GHashTable * |
hash, |
|
|
const char * |
always_first, |
|
|
gboolean |
overwrite, |
|
|
crm_time_t * |
now, |
|
|
crm_time_t * |
next_change |
|
) |
| |
Extract nvpair blocks contained by an XML element into a hash table.
- Parameters
-
[in] | top | XML document root (used to expand id-ref's) |
[in] | xml_obj | XML element containing blocks of nvpair elements |
[in] | set_name | Element name to identify nvpair blocks |
[in] | node_hash | Node attributes to use when evaluating rules |
[out] | hash | Where to store extracted name/value pairs |
[in] | always_first | If not NULL, process block with this ID first |
[in] | overwrite | Whether to replace existing values with same name |
[in] | now | Time to use when evaluating rules |
[out] | next_change | If not NULL, set to when rule evaluation will change |
Definition at line 538 of file rules.c.