This source file includes following definitions.
- recovery2text
1
2
3
4
5
6
7
8
9
10 #ifndef PCMK__CRM_PENGINE_COMMON_COMPAT__H
11 # define PCMK__CRM_PENGINE_COMMON_COMPAT__H
12
13 #include <crm/common/scheduler.h>
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19
20
21
22
23
24
25
26
27
28
29 #define RSC_ROLE_MAX (pcmk_role_promoted + 1)
30
31
32 #define RSC_ROLE_UNKNOWN_S pcmk_role_text(pcmk_role_unknown)
33
34
35 #define RSC_ROLE_STOPPED_S pcmk_role_text(pcmk_role_stopped)
36
37
38 #define RSC_ROLE_STARTED_S pcmk_role_text(pcmk_role_started)
39
40
41 #define RSC_ROLE_UNPROMOTED_S pcmk_role_text(pcmk_role_unpromoted)
42
43
44 #define RSC_ROLE_PROMOTED_S pcmk_role_text(pcmk_role_promoted)
45
46
47 #define RSC_ROLE_UNPROMOTED_LEGACY_S "Slave"
48
49
50 #define RSC_ROLE_SLAVE_S RSC_ROLE_UNPROMOTED_LEGACY_S
51
52
53 #define RSC_ROLE_PROMOTED_LEGACY_S "Master"
54
55
56 #define RSC_ROLE_MASTER_S RSC_ROLE_PROMOTED_LEGACY_S
57
58
59 const char *role2text(enum rsc_role_e role);
60
61
62 enum rsc_role_e text2role(const char *role);
63
64
65 const char *task2text(enum action_tasks task);
66
67
68 enum action_tasks text2task(const char *task);
69
70
71 const char *fail2text(enum action_fail_response fail);
72
73
74 static inline const char *
75 recovery2text(enum rsc_recovery_type type)
76 {
77 switch (type) {
78 case pcmk_multiply_active_stop:
79 return "shutting it down";
80 case pcmk_multiply_active_restart:
81 return "attempting recovery";
82 case pcmk_multiply_active_block:
83 return "waiting for an administrator";
84 case pcmk_multiply_active_unexpected:
85 return "stopping unexpected instances";
86 }
87 return "Unknown";
88 }
89
90
91 const char *pe_pref(GHashTable * options, const char *name);
92
93 #ifdef __cplusplus
94 }
95 #endif
96
97 #endif