pacemaker  2.1.9-49aab99839
Scalable High-Availability cluster resource manager
rules_compat.h
Go to the documentation of this file.
1 /*
2  * Copyright 2004-2024 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 PCMK__CRM_PENGINE_RULES_COMPAT__H
11 # define PCMK__CRM_PENGINE_RULES_COMPAT__H
12 
13 #include <glib.h>
14 #include <libxml/tree.h> // xmlNode
15 #include <crm/common/iso8601.h> // crm_time_t
16 #include <crm/pengine/pe_types.h>
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
31 gboolean pe_evaluate_rules(xmlNode *ruleset, GHashTable *node_hash,
33  crm_time_t *now, crm_time_t *next_change);
34 
36 gboolean pe_eval_rules(xmlNode *ruleset, const pe_rule_eval_data_t *rule_data,
37  crm_time_t *next_change);
38 
40 gboolean test_ruleset(xmlNode *ruleset, GHashTable *node_hash, crm_time_t *now);
41 
43 gboolean test_rule(xmlNode *rule, GHashTable *node_hash, enum rsc_role_e role,
44  crm_time_t *now);
45 
47 gboolean pe_test_rule(xmlNode *rule, GHashTable *node_hash,
48  enum rsc_role_e role, crm_time_t *now,
49  crm_time_t *next_change, pe_match_data_t *match_data);
50 
52 gboolean pe_test_rule_re(xmlNode *rule, GHashTable *node_hash,
53  enum rsc_role_e role, crm_time_t *now,
54  pe_re_match_data_t *re_match_data);
55 
57 gboolean pe_test_rule_full(xmlNode *rule, GHashTable *node_hash,
58  enum rsc_role_e role, crm_time_t *now,
59  pe_match_data_t *match_data);
60 
62 gboolean pe_test_expression(xmlNode *expr, GHashTable *node_hash,
63  enum rsc_role_e role, crm_time_t *now,
64  crm_time_t *next_change,
65  pe_match_data_t *match_data);
66 
68 gboolean test_expression(xmlNode *expr, GHashTable *node_hash,
69  enum rsc_role_e role, crm_time_t *now);
70 
72 gboolean pe_test_expression_re(xmlNode *expr, GHashTable *node_hash,
73  enum rsc_role_e role, crm_time_t *now,
74  pe_re_match_data_t *re_match_data);
75 
77 gboolean pe_test_expression_full(xmlNode *expr, GHashTable *node_hash,
78  enum rsc_role_e role,
79  crm_time_t *now, pe_match_data_t *match_data);
80 
82 gboolean pe_eval_expr(xmlNode *rule, const pe_rule_eval_data_t *rule_data,
83  crm_time_t *next_change);
84 
86 gboolean pe_eval_subexpr(xmlNode *expr, const pe_rule_eval_data_t *rule_data,
87  crm_time_t *next_change);
88 
90 void unpack_instance_attributes(xmlNode *top, xmlNode *xml_obj,
91  const char *set_name, GHashTable *node_hash,
92  GHashTable *hash, const char *always_first,
93  gboolean overwrite, crm_time_t *now);
94 
96 enum expression_type find_expression_type(xmlNode *expr);
97 
99 char *pe_expand_re_matches(const char *string,
100  const pe_re_match_data_t *match_data);
101 
102 #ifdef __cplusplus
103 }
104 #endif
105 
106 #endif // PCMK__CRM_PENGINE_RULES_COMPAT__H
gboolean pe_test_expression_full(xmlNode *expr, GHashTable *node_hash, enum rsc_role_e role, crm_time_t *now, pe_match_data_t *match_data)
Definition: rules.c:420
struct crm_time_s crm_time_t
Definition: iso8601.h:32
gboolean pe_test_rule_full(xmlNode *rule, GHashTable *node_hash, enum rsc_role_e role, crm_time_t *now, pe_match_data_t *match_data)
Definition: rules.c:373
gboolean pe_evaluate_rules(xmlNode *ruleset, GHashTable *node_hash, crm_time_t *now, crm_time_t *next_change)
Definition: rules.c:316
gboolean test_expression(xmlNode *expr, GHashTable *node_hash, enum rsc_role_e role, crm_time_t *now)
Definition: rules.c:403
expression_type
Definition: rules.h:33
gboolean pe_eval_expr(xmlNode *rule, const pe_rule_eval_data_t *rule_data, crm_time_t *next_change)
Definition: rules.c:428
gboolean pe_test_rule_re(xmlNode *rule, GHashTable *node_hash, enum rsc_role_e role, crm_time_t *now, pe_re_match_data_t *re_match_data)
Definition: rules.c:362
gboolean pe_eval_subexpr(xmlNode *expr, const pe_rule_eval_data_t *rule_data, crm_time_t *next_change)
Definition: rules.c:438
rsc_role_e
Definition: roles.h:34
ISO_8601 Date handling.
gboolean pe_test_expression_re(xmlNode *expr, GHashTable *node_hash, enum rsc_role_e role, crm_time_t *now, pe_re_match_data_t *re_match_data)
Definition: rules.c:409
void unpack_instance_attributes(xmlNode *top, xmlNode *xml_obj, const char *set_name, GHashTable *node_hash, GHashTable *hash, const char *always_first, gboolean overwrite, crm_time_t *now)
Definition: rules.c:449
gboolean test_ruleset(xmlNode *ruleset, GHashTable *node_hash, crm_time_t *now)
Definition: rules.c:350
char * pe_expand_re_matches(const char *string, const pe_re_match_data_t *match_data)
Definition: rules.c:473
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)
Definition: rules.c:380
gboolean test_rule(xmlNode *rule, GHashTable *node_hash, enum rsc_role_e role, crm_time_t *now)
Definition: rules.c:356
gboolean pe_eval_rules(xmlNode *ruleset, const pe_rule_eval_data_t *rule_data, crm_time_t *next_change)
Definition: rules.c:305
enum expression_type find_expression_type(xmlNode *expr)
Definition: rules.c:467
Data types for cluster status.
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:328