pacemaker 2.1.7-2.1.7
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
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
21extern "C" {
22#endif
23
25#define PCMK__OP_FMT "%s_%s_%u"
26
27char *pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms);
28char *pcmk__notify_key(const char *rsc_id, const char *notify_type,
29 const char *op_type);
30char *pcmk__transition_key(int transition_id, int action_id, int target_rc,
31 const char *node);
32void pcmk__filter_op_for_digest(xmlNode *param_set);
33bool pcmk__is_fencing_action(const char *action);
34
44static inline const char *
45pcmk__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
APIs related to actions.
#define PCMK_ACTION_MONITOR
Definition actions.h:59
void pcmk__filter_op_for_digest(xmlNode *param_set)
Definition actions.c:344
char * pcmk__notify_key(const char *rsc_id, const char *notify_type, const char *op_type)
Definition actions.c:183
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
bool pcmk__is_fencing_action(const char *action)
Definition actions.c:489
char * pcmk__transition_key(int transition_id, int action_id, int target_rc, const char *node)
Definition actions.c:250
const char * action
Definition pcmk_fence.c:30
@ pcmk__str_none