pacemaker  2.1.7-0f7f88312f
Scalable High-Availability cluster resource manager
actions_internal.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_COMMON_ACTIONS_INTERNAL__H
11 #define PCMK__CRM_COMMON_ACTIONS_INTERNAL__H
12 
13 #include <stdbool.h> // bool
14 #include <glib.h> // guint
15 #include <libxml/tree.h> // xmlNode
16 
17 #include <crm/common/actions.h> // PCMK_ACTION_MONITOR
18 #include <crm/common/strings_internal.h> // pcmk__str_eq()
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
25 #define PCMK__OP_FMT "%s_%s_%u"
26 
27 char *pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms);
28 char *pcmk__notify_key(const char *rsc_id, const char *notify_type,
29  const char *op_type);
30 char *pcmk__transition_key(int transition_id, int action_id, int target_rc,
31  const char *node);
32 void pcmk__filter_op_for_digest(xmlNode *param_set);
33 bool pcmk__is_fencing_action(const char *action);
34 
44 static inline const char *
45 pcmk__readable_action(const char *action_name, guint interval_ms) {
46  if ((interval_ms == 0)
47  && pcmk__str_eq(action_name, PCMK_ACTION_MONITOR, pcmk__str_none)) {
48  return "probe";
49  }
50  return action_name;
51 }
52 
53 #ifdef __cplusplus
54 }
55 #endif
56 
57 #endif // PCMK__CRM_COMMON_ACTIONS_INTERNAL__H
void pcmk__filter_op_for_digest(xmlNode *param_set)
Definition: actions.c:344
APIs related to actions.
#define PCMK_ACTION_MONITOR
Definition: actions.h:59
const char * action
Definition: pcmk_fence.c:30
char * pcmk__transition_key(int transition_id, int action_id, int target_rc, const char *node)
Definition: actions.c:250
char * pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms)
Generate an operation key (RESOURCE_ACTION_INTERVAL)
Definition: actions.c:42
char * pcmk__notify_key(const char *rsc_id, const char *notify_type, const char *op_type)
Definition: actions.c:183
bool pcmk__is_fencing_action(const char *action)
Definition: actions.c:489