pacemaker 2.1.7-2.1.7
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
common.h
Go to the documentation of this file.
1/*
2 * Copyright 2004-2023 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_COMMON__H
11# define PCMK__CRM_PENGINE_COMMON__H
12
13# include <glib.h>
14# include <regex.h>
15# include <crm/common/iso8601.h>
16# include <crm/common/scheduler.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22extern gboolean was_processing_error;
23extern gboolean was_processing_warning;
24
25const char *task2text(enum action_tasks task);
26enum action_tasks text2task(const char *task);
27enum rsc_role_e text2role(const char *role);
28const char *role2text(enum rsc_role_e role);
29const char *fail2text(enum action_fail_response fail);
30
31const char *pe_pref(GHashTable * options, const char *name);
32
40static inline const char *
41recovery2text(enum rsc_recovery_type type)
42{
43 switch (type) {
45 return "shutting it down";
47 return "attempting recovery";
49 return "waiting for an administrator";
51 return "stopping unexpected instances";
52 }
53 return "Unknown";
54}
55
56typedef struct pe_re_match_data {
57 char *string;
58 int nregs;
59 regmatch_t *pmatch;
61
62typedef struct pe_match_data {
64 GHashTable *params;
65 GHashTable *meta;
67
68typedef struct pe_rsc_eval_data {
69 const char *standard;
70 const char *provider;
71 const char *agent;
73
74typedef struct pe_op_eval_data {
75 const char *op_name;
76 guint interval;
78
79typedef struct pe_rule_eval_data {
80 GHashTable *node_hash; // Only used with g_hash_table_lookup()
82 crm_time_t *now; // @COMPAT could be const
83 pe_match_data_t *match_data; // @COMPAT could be const
84 pe_rsc_eval_data_t *rsc_data; // @COMPAT could be const
85 pe_op_eval_data_t *op_data; // @COMPAT could be const
87
88#if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
90#endif
91
92#ifdef __cplusplus
93}
94#endif
95
96#endif
action_fail_response
Possible responses to a resource action failure.
Definition actions.h:149
action_tasks
Possible actions (including some pseudo-actions)
Definition actions.h:79
const char * name
Definition cib.c:26
enum action_tasks text2task(const char *task)
Definition common.c:360
gboolean was_processing_error
Definition common.c:21
const char * fail2text(enum action_fail_response fail)
Definition common.c:320
struct pe_rule_eval_data pe_rule_eval_data_t
const char * role2text(enum rsc_role_e role)
Definition common.c:458
const char * task2text(enum action_tasks task)
Definition common.c:405
const char * pe_pref(GHashTable *options, const char *name)
Definition common.c:314
struct pe_match_data pe_match_data_t
gboolean was_processing_warning
Definition common.c:22
struct pe_re_match_data pe_re_match_data_t
struct pe_op_eval_data pe_op_eval_data_t
enum rsc_role_e text2role(const char *role)
Definition common.c:487
struct pe_rsc_eval_data pe_rsc_eval_data_t
Deprecated Pacemaker scheduler utilities.
enum crm_ais_msg_types type
Definition cpg.c:3
ISO_8601 Date handling.
struct crm_time_s crm_time_t
Definition iso8601.h:32
rsc_recovery_type
How to recover a resource that is incorrectly active on multiple nodes.
Definition resources.h:76
@ pcmk_multiply_active_block
Do nothing to resource.
Definition resources.h:79
@ pcmk_multiply_active_restart
Stop on all, start on desired.
Definition resources.h:77
@ pcmk_multiply_active_stop
Stop on all and leave stopped.
Definition resources.h:78
@ pcmk_multiply_active_unexpected
Stop unexpected instances.
Definition resources.h:80
rsc_role_e
Definition roles.h:27
Scheduler API.
GHashTable * meta
Definition common.h:65
pe_re_match_data_t * re
Definition common.h:63
GHashTable * params
Definition common.h:64
const char * op_name
Definition common.h:75
guint interval
Definition common.h:76
regmatch_t * pmatch
Definition common.h:59
char * string
Definition common.h:57
const char * agent
Definition common.h:71
const char * provider
Definition common.h:70
const char * standard
Definition common.h:69
pe_rsc_eval_data_t * rsc_data
Definition common.h:84
GHashTable * node_hash
Definition common.h:80
enum rsc_role_e role
Definition common.h:81
crm_time_t * now
Definition common.h:82
pe_match_data_t * match_data
Definition common.h:83
pe_op_eval_data_t * op_data
Definition common.h:85