pacemaker  2.1.0-7c3f660
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
rules.h
Go to the documentation of this file.
1 /*
2  * Copyright 2004-2021 the Pacemaker project contributors
3  *
4  * The version control history for this file may have further details.
5  *
6  * This source code is licensed under the GNU Lesser General Public License
7  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8  */
9 
10 #ifndef PENGINE_RULES__H
11 # define PENGINE_RULES__H
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 # include <glib.h>
18 
19 # include <crm/crm.h>
20 # include <crm/common/iso8601.h>
21 # include <crm/pengine/common.h>
22 
33 };
34 
35 enum expression_type find_expression_type(xmlNode * expr);
36 
37 gboolean pe_evaluate_rules(xmlNode *ruleset, GHashTable *node_hash,
38  crm_time_t *now, crm_time_t *next_change);
39 
40 gboolean pe_test_rule(xmlNode *rule, GHashTable *node_hash,
41  enum rsc_role_e role, crm_time_t *now,
42  crm_time_t *next_change, pe_match_data_t *match_data);
43 
44 gboolean pe_test_expression(xmlNode *expr, GHashTable *node_hash,
45  enum rsc_role_e role, crm_time_t *now,
46  crm_time_t *next_change,
47  pe_match_data_t *match_data);
48 
49 void pe_eval_nvpairs(xmlNode *top, xmlNode *xml_obj, const char *set_name,
50  pe_rule_eval_data_t *rule_data, GHashTable *hash,
51  const char *always_first, gboolean overwrite,
52  crm_time_t *next_change);
53 
54 void pe_unpack_nvpairs(xmlNode *top, xmlNode *xml_obj, const char *set_name,
55  GHashTable *node_hash, GHashTable *hash,
56  const char *always_first, gboolean overwrite,
57  crm_time_t *now, crm_time_t *next_change);
58 
59 #if ENABLE_VERSIONED_ATTRS
60 void pe_eval_versioned_attributes(xmlNode *top, xmlNode *xml_obj,
61  const char *set_name, pe_rule_eval_data_t *rule_data,
62  xmlNode *hash, crm_time_t *next_change);
63 
64 GHashTable *pe_unpack_versioned_parameters(xmlNode *versioned_params, const char *ra_version);
65 #endif
66 
67 char *pe_expand_re_matches(const char *string, pe_re_match_data_t * match_data);
68 
69 gboolean pe_eval_rules(xmlNode *ruleset, pe_rule_eval_data_t *rule_data,
70  crm_time_t *next_change);
71 gboolean pe_eval_expr(xmlNode *rule, pe_rule_eval_data_t *rule_data,
72  crm_time_t *next_change);
73 gboolean pe_eval_subexpr(xmlNode *expr, pe_rule_eval_data_t *rule_data,
74  crm_time_t *next_change);
75 
76 #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
78 #endif
79 
80 #ifdef __cplusplus
81 }
82 #endif
83 
84 #endif
A dumping ground.
Definition: rules.h:31
Deprecated Pacemaker rule API.
gboolean pe_eval_rules(xmlNode *ruleset, pe_rule_eval_data_t *rule_data, crm_time_t *next_change)
Definition: rules.c:740
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.
Definition: rules.c:628
void pe_eval_nvpairs(xmlNode *top, 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)
Definition: rules.c:605
struct crm_time_s crm_time_t
Definition: iso8601.h:32
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)
Definition: rules.c:55
gboolean pe_eval_expr(xmlNode *rule, pe_rule_eval_data_t *rule_data, crm_time_t *next_change)
Definition: rules.c:764
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)
Definition: rules.c:88
Definition: rules.h:32
enum expression_type find_expression_type(xmlNode *expr)
Definition: rules.c:105
Definition: rules.h:24
ISO_8601 Date handling.
gboolean pe_eval_subexpr(xmlNode *expr, pe_rule_eval_data_t *rule_data, crm_time_t *next_change)
Definition: rules.c:806
char * pe_expand_re_matches(const char *string, pe_re_match_data_t *match_data)
Definition: rules.c:658
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.
Definition: rules.c:39
rsc_role_e
Possible roles that a resource can be in.
Definition: common.h:92
Definition: rules.h:27
expression_type
Definition: rules.h:23