pacemaker  2.1.8-3980678f03
Scalable High-Availability cluster resource manager
Data Structures | Typedefs | Functions
rules.h File Reference

Scheduler API for rules. More...

#include <glib.h>
#include <regex.h>
#include <libxml/tree.h>
#include <crm/common/iso8601.h>
Include dependency graph for rules.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pcmk_rule_input
 Data used to evaluate a rule (any NULL items are ignored) More...
 

Typedefs

typedef struct pcmk_rule_input pcmk_rule_input_t
 Data used to evaluate a rule (any NULL items are ignored) More...
 

Enumerations

enum  expression_type {
  pcmk__condition_unknown = 0, pcmk__condition_rule = 1, pcmk__condition_attribute = 2, pcmk__condition_location = 3,
  pcmk__condition_datetime = 5, pcmk__condition_resource = 7, pcmk__condition_operation = 8, not_expr = pcmk__condition_unknown,
  nested_rule = pcmk__condition_rule, attr_expr = pcmk__condition_attribute, loc_expr = pcmk__condition_location, role_expr = 4,
  time_expr = pcmk__condition_datetime, version_expr = 6, rsc_expr = pcmk__condition_resource, op_expr = pcmk__condition_operation
}
 

Functions

int pcmk_evaluate_rule (xmlNode *rule, const pcmk_rule_input_t *rule_input, crm_time_t *next_change)
 Evaluate a single rule, including all its conditions. More...
 

Detailed Description

Scheduler API for rules.

Definition in file rules.h.

Typedef Documentation

◆ pcmk_rule_input_t

Data used to evaluate a rule (any NULL items are ignored)

Enumeration Type Documentation

◆ expression_type

Deprecated:
For Pacemaker use only
Enumerator
pcmk__condition_unknown 
pcmk__condition_rule 
pcmk__condition_attribute 
pcmk__condition_location 
pcmk__condition_datetime 
pcmk__condition_resource 
pcmk__condition_operation 
not_expr 
nested_rule 
attr_expr 
loc_expr 
role_expr 
time_expr 
version_expr 
rsc_expr 
op_expr 

Definition at line 33 of file rules.h.

Function Documentation

◆ pcmk_evaluate_rule()

int pcmk_evaluate_rule ( xmlNode *  rule,
const pcmk_rule_input_t rule_input,
crm_time_t next_change 
)

Evaluate a single rule, including all its conditions.

Parameters
[in,out]ruleXML containing a rule definition or its id-ref
[in]rule_inputValues used to evaluate rule criteria
[out]next_changeIf not NULL, set to when evaluation will change
Returns
Standard Pacemaker return code (pcmk_rc_ok if the rule is satisfied, some other value if it is not)

Definition at line 1385 of file rules.c.