This source file includes following definitions.
- recovery2text
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #ifndef PE_COMMON__H
19 # define PE_COMMON__H
20 # include <glib.h>
21
22 extern gboolean was_processing_error;
23 extern gboolean was_processing_warning;
24
25
26
27
28
29 enum action_fail_response {
30 action_fail_ignore,
31 action_fail_recover,
32 action_fail_migrate,
33 action_fail_block,
34 action_fail_stop,
35 action_fail_standby,
36 action_fail_fence,
37 action_fail_restart_container,
38
39
40
41
42
43
44
45
46
47 action_fail_reset_remote,
48
49 };
50
51
52 enum action_tasks {
53 no_action,
54 monitor_rsc,
55 stop_rsc,
56 stopped_rsc,
57 start_rsc,
58 started_rsc,
59 action_notify,
60 action_notified,
61 action_promote,
62 action_promoted,
63 action_demote,
64 action_demoted,
65 shutdown_crm,
66 stonith_node
67 };
68
69 enum rsc_recovery_type {
70 recovery_stop_start,
71 recovery_stop_only,
72 recovery_block
73 };
74
75 enum rsc_start_requirement {
76 rsc_req_nothing,
77 rsc_req_quorum,
78 rsc_req_stonith
79 };
80
81 enum rsc_role_e {
82 RSC_ROLE_UNKNOWN,
83 RSC_ROLE_STOPPED,
84 RSC_ROLE_STARTED,
85 RSC_ROLE_SLAVE,
86 RSC_ROLE_MASTER,
87 };
88
89 # define RSC_ROLE_MAX RSC_ROLE_MASTER+1
90
91 # define RSC_ROLE_UNKNOWN_S "Unknown"
92 # define RSC_ROLE_STOPPED_S "Stopped"
93 # define RSC_ROLE_STARTED_S "Started"
94 # define RSC_ROLE_SLAVE_S "Slave"
95 # define RSC_ROLE_MASTER_S "Master"
96
97 enum pe_print_options {
98 pe_print_log = 0x0001,
99 pe_print_html = 0x0002,
100 pe_print_ncurses = 0x0004,
101 pe_print_printf = 0x0008,
102 pe_print_dev = 0x0010,
103 pe_print_details = 0x0020,
104 pe_print_max_details = 0x0040,
105 pe_print_rsconly = 0x0080,
106 pe_print_ops = 0x0100,
107 pe_print_suppres_nl = 0x0200,
108 pe_print_xml = 0x0400,
109 pe_print_brief = 0x0800,
110 pe_print_pending = 0x1000,
111 pe_print_clone_details = 0x2000,
112 pe_print_clone_active = 0x4000,
113 pe_print_implicit = 0x8000,
114 };
115
116 const char *task2text(enum action_tasks task);
117 enum action_tasks text2task(const char *task);
118 enum rsc_role_e text2role(const char *role);
119 const char *role2text(enum rsc_role_e role);
120 const char *fail2text(enum action_fail_response fail);
121
122 const char *pe_pref(GHashTable * options, const char *name);
123 void calculate_active_ops(GList * sorted_op_list, int *start_index, int *stop_index);
124
125 static inline const char *
126 recovery2text(enum rsc_recovery_type type)
127 {
128 switch (type) {
129 case recovery_stop_only:
130 return "shutting it down";
131 case recovery_stop_start:
132 return "attempting recovery";
133 case recovery_block:
134 return "waiting for an administrator";
135 }
136 return "Unknown";
137 }
138
139 #endif