This source file includes following definitions.
- recovery2text
1
2
3
4
5
6
7
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
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 extern gboolean was_processing_error;
22 extern gboolean was_processing_warning;
23
24
25
26
27
28
29
30
31
32
33 enum action_fail_response {
34 action_fail_ignore,
35
36 action_fail_recover,
37
38
39 action_fail_migrate,
40 action_fail_block,
41 action_fail_stop,
42 action_fail_standby,
43 action_fail_fence,
44
45
46
47 action_fail_restart_container,
48
49
50
51
52
53
54
55 action_fail_reset_remote,
56
57 action_fail_demote,
58 };
59
60
61 enum action_tasks {
62 no_action,
63 monitor_rsc,
64 stop_rsc,
65 stopped_rsc,
66 start_rsc,
67 started_rsc,
68 action_notify,
69 action_notified,
70 action_promote,
71 action_promoted,
72 action_demote,
73 action_demoted,
74 shutdown_crm,
75 stonith_node
76 };
77
78 enum rsc_recovery_type {
79 recovery_stop_start,
80 recovery_stop_only,
81 recovery_block,
82 recovery_stop_unexpected,
83 };
84
85 enum rsc_start_requirement {
86 rsc_req_nothing,
87 rsc_req_quorum,
88 rsc_req_stonith
89 };
90
91
92 enum rsc_role_e {
93 RSC_ROLE_UNKNOWN = 0,
94 RSC_ROLE_STOPPED = 1,
95 RSC_ROLE_STARTED = 2,
96 RSC_ROLE_UNPROMOTED = 3,
97 RSC_ROLE_PROMOTED = 4,
98
99 #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
100
101 RSC_ROLE_SLAVE = RSC_ROLE_UNPROMOTED,
102
103
104 RSC_ROLE_MASTER = RSC_ROLE_PROMOTED,
105 #endif
106 };
107
108 # define RSC_ROLE_MAX (RSC_ROLE_PROMOTED + 1)
109
110 # define RSC_ROLE_UNKNOWN_S "Unknown"
111 # define RSC_ROLE_STOPPED_S "Stopped"
112 # define RSC_ROLE_STARTED_S "Started"
113 # define RSC_ROLE_UNPROMOTED_S "Unpromoted"
114 # define RSC_ROLE_PROMOTED_S "Promoted"
115 # define RSC_ROLE_UNPROMOTED_LEGACY_S "Slave"
116 # define RSC_ROLE_PROMOTED_LEGACY_S "Master"
117
118
119 enum pe_print_options {
120 pe_print_log = (1 << 0),
121 pe_print_html = (1 << 1),
122 pe_print_ncurses = (1 << 2),
123 pe_print_printf = (1 << 3),
124 pe_print_dev = (1 << 4),
125 pe_print_details = (1 << 5),
126 pe_print_max_details = (1 << 6),
127 pe_print_rsconly = (1 << 7),
128 pe_print_ops = (1 << 8),
129 pe_print_suppres_nl = (1 << 9),
130 pe_print_xml = (1 << 10),
131 pe_print_brief = (1 << 11),
132 pe_print_pending = (1 << 12),
133 pe_print_clone_details = (1 << 13),
134 pe_print_clone_active = (1 << 14),
135 pe_print_implicit = (1 << 15)
136 };
137
138 const char *task2text(enum action_tasks task);
139 enum action_tasks text2task(const char *task);
140 enum rsc_role_e text2role(const char *role);
141 const char *role2text(enum rsc_role_e role);
142 const char *fail2text(enum action_fail_response fail);
143
144 const char *pe_pref(GHashTable * options, const char *name);
145 void calculate_active_ops(GList * sorted_op_list, int *start_index, int *stop_index);
146
147
148
149
150
151
152
153
154 static inline const char *
155 recovery2text(enum rsc_recovery_type type)
156 {
157 switch (type) {
158 case recovery_stop_only:
159 return "shutting it down";
160 case recovery_stop_start:
161 return "attempting recovery";
162 case recovery_block:
163 return "waiting for an administrator";
164 case recovery_stop_unexpected:
165 return "stopping unexpected instances";
166 }
167 return "Unknown";
168 }
169
170 typedef struct pe_re_match_data {
171 char *string;
172 int nregs;
173 regmatch_t *pmatch;
174 } pe_re_match_data_t;
175
176 typedef struct pe_match_data {
177 pe_re_match_data_t *re;
178 GHashTable *params;
179 GHashTable *meta;
180 } pe_match_data_t;
181
182 typedef struct pe_rsc_eval_data {
183 const char *standard;
184 const char *provider;
185 const char *agent;
186 } pe_rsc_eval_data_t;
187
188 typedef struct pe_op_eval_data {
189 const char *op_name;
190 guint interval;
191 } pe_op_eval_data_t;
192
193 typedef struct pe_rule_eval_data {
194 GHashTable *node_hash;
195 enum rsc_role_e role;
196 crm_time_t *now;
197 pe_match_data_t *match_data;
198 pe_rsc_eval_data_t *rsc_data;
199 pe_op_eval_data_t *op_data;
200 } pe_rule_eval_data_t;
201
202 #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
203 #include <crm/pengine/common_compat.h>
204 #endif
205
206 #ifdef __cplusplus
207 }
208 #endif
209
210 #endif