pacemaker 2.1.8-2.1.8
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
common_compat.h
Go to the documentation of this file.
1/*
2 * Copyright 2004-2024 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_PENGINE_COMMON_COMPAT__H
11# define PCMK__CRM_PENGINE_COMMON_COMPAT__H
12
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
29#define RSC_ROLE_MAX (pcmk_role_promoted + 1)
30
32#define RSC_ROLE_UNKNOWN_S pcmk_role_text(pcmk_role_unknown)
33
35#define RSC_ROLE_STOPPED_S pcmk_role_text(pcmk_role_stopped)
36
38#define RSC_ROLE_STARTED_S pcmk_role_text(pcmk_role_started)
39
41#define RSC_ROLE_UNPROMOTED_S pcmk_role_text(pcmk_role_unpromoted)
42
44#define RSC_ROLE_PROMOTED_S pcmk_role_text(pcmk_role_promoted)
45
47#define RSC_ROLE_UNPROMOTED_LEGACY_S "Slave"
48
50#define RSC_ROLE_SLAVE_S RSC_ROLE_UNPROMOTED_LEGACY_S
51
53#define RSC_ROLE_PROMOTED_LEGACY_S "Master"
54
56#define RSC_ROLE_MASTER_S RSC_ROLE_PROMOTED_LEGACY_S
57
59const char *role2text(enum rsc_role_e role);
60
62enum rsc_role_e text2role(const char *role);
63
65const char *task2text(enum action_tasks task);
66
68enum action_tasks text2task(const char *task);
69
71const char *fail2text(enum action_fail_response fail);
72
74static inline const char *
75recovery2text(enum rsc_recovery_type type)
76{
77 switch (type) {
79 return "shutting it down";
81 return "attempting recovery";
83 return "waiting for an administrator";
85 return "stopping unexpected instances";
86 }
87 return "Unknown";
88}
89
91const char *pe_pref(GHashTable * options, const char *name);
92
93#ifdef __cplusplus
94}
95#endif
96
97#endif // PCMK__CRM_PENGINE_COMMON_COMPAT__H
action_fail_response
Definition actions.h:130
action_tasks
Definition actions.h:83
const char * name
Definition cib.c:26
enum action_tasks text2task(const char *task)
Definition common.c:44
const char * fail2text(enum action_fail_response fail)
Definition common.c:56
const char * role2text(enum rsc_role_e role)
Definition common.c:26
const char * task2text(enum action_tasks task)
Definition common.c:38
const char * pe_pref(GHashTable *options, const char *name)
Definition common.c:50
enum rsc_role_e text2role(const char *role)
Definition common.c:32
enum crm_ais_msg_types type
Definition cpg.c:3
rsc_recovery_type
Definition resources.h:65
@ pcmk_multiply_active_block
Definition resources.h:68
@ pcmk_multiply_active_restart
Definition resources.h:66
@ pcmk_multiply_active_stop
Definition resources.h:67
@ pcmk_multiply_active_unexpected
Definition resources.h:69
rsc_role_e
Definition roles.h:34
Scheduler API.