pacemaker 2.1.6-6fdc9deea29
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
rules.h
Go to the documentation of this file.
1/*
2 * Copyright 2004-2022 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__H
11# define PCMK__CRM_PENGINE_RULES__H
12
13# include <glib.h>
14# include <crm/crm.h>
15# include <crm/common/iso8601.h>
16# include <crm/pengine/common.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
29#if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
32#endif
35};
36
37enum expression_type find_expression_type(xmlNode * expr);
38
39gboolean pe_evaluate_rules(xmlNode *ruleset, GHashTable *node_hash,
40 crm_time_t *now, crm_time_t *next_change);
41
42gboolean pe_test_rule(xmlNode *rule, GHashTable *node_hash,
43 enum rsc_role_e role, crm_time_t *now,
44 crm_time_t *next_change, pe_match_data_t *match_data);
45
46gboolean pe_test_expression(xmlNode *expr, GHashTable *node_hash,
47 enum rsc_role_e role, crm_time_t *now,
48 crm_time_t *next_change,
49 pe_match_data_t *match_data);
50
51void pe_eval_nvpairs(xmlNode *top, const xmlNode *xml_obj, const char *set_name,
52 const pe_rule_eval_data_t *rule_data, GHashTable *hash,
53 const char *always_first, gboolean overwrite,
54 crm_time_t *next_change);
55
56void pe_unpack_nvpairs(xmlNode *top, const xmlNode *xml_obj,
57 const char *set_name, GHashTable *node_hash,
58 GHashTable *hash, const char *always_first,
59 gboolean overwrite, crm_time_t *now,
60 crm_time_t *next_change);
61
62char *pe_expand_re_matches(const char *string,
63 const pe_re_match_data_t *match_data);
64
65gboolean pe_eval_rules(xmlNode *ruleset, const pe_rule_eval_data_t *rule_data,
66 crm_time_t *next_change);
67gboolean pe_eval_expr(xmlNode *rule, const pe_rule_eval_data_t *rule_data,
68 crm_time_t *next_change);
69gboolean pe_eval_subexpr(xmlNode *expr, const pe_rule_eval_data_t *rule_data,
70 crm_time_t *next_change);
71
72#if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
74#endif
75
76#ifdef __cplusplus
77}
78#endif
79
80#endif
rsc_role_e
Possible roles that a resource can be in.
Definition common.h:92
A dumping ground.
ISO_8601 Date handling.
struct crm_time_s crm_time_t
Definition iso8601.h:32
enum expression_type find_expression_type(xmlNode *expr)
Definition rules.c:105
expression_type
Definition rules.h:22
@ not_expr
Definition rules.h:23
@ rsc_expr
Definition rules.h:33
@ op_expr
Definition rules.h:34
@ role_expr
Definition rules.h:27
@ attr_expr
Definition rules.h:25
@ version_expr
Definition rules.h:31
@ nested_rule
Definition rules.h:24
@ time_expr
Definition rules.h:28
@ loc_expr
Definition rules.h:26
char * pe_expand_re_matches(const char *string, const pe_re_match_data_t *match_data)
Expand any regular expression submatches (%0-%9) in a string.
Definition rules.c:560
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_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
gboolean pe_eval_subexpr(xmlNode *expr, const pe_rule_eval_data_t *rule_data, crm_time_t *next_change)
Evaluate a single rule expression, including any subexpressions.
Definition rules.c:712
gboolean pe_eval_rules(xmlNode *ruleset, const pe_rule_eval_data_t *rule_data, crm_time_t *next_change)
Evaluate rules.
Definition rules.c:626
void pe_unpack_nvpairs(xmlNode *top, const 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:532
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
gboolean pe_eval_expr(xmlNode *rule, const pe_rule_eval_data_t *rule_data, crm_time_t *next_change)
Evaluate all of a rule's expressions.
Definition rules.c:660
void pe_eval_nvpairs(xmlNode *top, const xmlNode *xml_obj, const char *set_name, const pe_rule_eval_data_t *rule_data, GHashTable *hash, const char *always_first, gboolean overwrite, crm_time_t *next_change)
Extract nvpair blocks contained by an XML element into a hash table.
Definition rules.c:497
Deprecated Pacemaker rule API.