This source file includes following definitions.
- pcmk__readable_action
1
2
3
4
5
6
7
8
9
10 #ifndef PCMK__CRM_COMMON_ACTIONS_INTERNAL__H
11 #define PCMK__CRM_COMMON_ACTIONS_INTERNAL__H
12
13 #include <stdbool.h>
14 #include <glib.h>
15 #include <libxml/tree.h>
16
17 #include <crm/common/actions.h>
18 #include <crm/common/strings_internal.h>
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24
25
26
27 #define PCMK__ACTION_POWEROFF "poweroff"
28
29
30
31 #define PCMK__OP_FMT "%s_%s_%u"
32
33
34
35
36
37
38
39
40 #define pcmk__set_action_flags(action, flags_to_set) do { \
41 (action)->flags = pcmk__set_flags_as(__func__, __LINE__, \
42 LOG_TRACE, \
43 "Action", (action)->uuid, \
44 (action)->flags, \
45 (flags_to_set), \
46 #flags_to_set); \
47 } while (0)
48
49
50
51
52
53
54
55
56 #define pcmk__clear_action_flags(action, flags_to_clear) do { \
57 (action)->flags = pcmk__clear_flags_as(__func__, __LINE__, \
58 LOG_TRACE, \
59 "Action", (action)->uuid, \
60 (action)->flags, \
61 (flags_to_clear), \
62 #flags_to_clear); \
63 } while (0)
64
65
66
67
68
69
70
71
72
73 #define pcmk__set_raw_action_flags(action_flags, action_name, to_set) do { \
74 action_flags = pcmk__set_flags_as(__func__, __LINE__, \
75 LOG_TRACE, "Action", action_name, \
76 (action_flags), \
77 (to_set), #to_set); \
78 } while (0)
79
80
81
82
83
84
85
86
87
88 #define pcmk__clear_raw_action_flags(action_flags, action_name, to_clear) \
89 do { \
90 action_flags = pcmk__clear_flags_as(__func__, __LINE__, LOG_TRACE, \
91 "Action", action_name, \
92 (action_flags), \
93 (to_clear), #to_clear); \
94 } while (0)
95
96 char *pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms);
97 char *pcmk__notify_key(const char *rsc_id, const char *notify_type,
98 const char *op_type);
99 char *pcmk__transition_key(int transition_id, int action_id, int target_rc,
100 const char *node);
101 void pcmk__filter_op_for_digest(xmlNode *param_set);
102 bool pcmk__is_fencing_action(const char *action);
103
104
105
106
107
108
109
110
111
112
113 static inline const char *
114 pcmk__readable_action(const char *action_name, guint interval_ms) {
115 if ((interval_ms == 0)
116 && pcmk__str_eq(action_name, PCMK_ACTION_MONITOR, pcmk__str_none)) {
117 return "probe";
118 }
119 return action_name;
120 }
121
122 #ifdef __cplusplus
123 }
124 #endif
125
126 #endif