pacemaker
2.1.8-3980678f03
Scalable High-Availability cluster resource manager
include
crm
common
roles.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_COMMON_ROLES__H
11
#define PCMK__CRM_COMMON_ROLES__H
12
13
#ifdef __cplusplus
14
extern
"C"
{
15
#endif
16
23
// String equivalents of enum rsc_role_e
24
25
#define PCMK_ROLE_STOPPED "Stopped"
26
#define PCMK_ROLE_STARTED "Started"
27
#define PCMK_ROLE_UNPROMOTED "Unpromoted"
28
#define PCMK_ROLE_PROMOTED "Promoted"
29
34
enum
rsc_role_e
{
35
pcmk_role_unknown
= 0,
36
pcmk_role_stopped
= 1,
37
pcmk_role_started
= 2,
38
pcmk_role_unpromoted
= 3,
39
pcmk_role_promoted
= 4,
40
41
#if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
42
RSC_ROLE_UNKNOWN
=
pcmk_role_unknown
,
44
46
RSC_ROLE_STOPPED
=
pcmk_role_stopped
,
47
49
RSC_ROLE_STARTED
=
pcmk_role_started
,
50
52
RSC_ROLE_UNPROMOTED
=
pcmk_role_unpromoted
,
53
55
RSC_ROLE_SLAVE
=
pcmk_role_unpromoted
,
56
58
RSC_ROLE_PROMOTED
=
pcmk_role_promoted
,
59
61
RSC_ROLE_MASTER
=
pcmk_role_promoted
,
62
#endif
63
};
64
65
const
char
*
pcmk_role_text
(
enum
rsc_role_e
role);
66
enum
rsc_role_e
pcmk_parse_role
(
const
char
*role);
67
68
#ifdef __cplusplus
69
}
70
#endif
71
72
#endif // PCMK__CRM_COMMON_ROLES__H
pcmk_role_text
const char * pcmk_role_text(enum rsc_role_e role)
Get readable description of a resource role.
Definition:
roles.c:23
RSC_ROLE_STOPPED
Definition:
roles.h:46
RSC_ROLE_PROMOTED
Definition:
roles.h:58
RSC_ROLE_UNPROMOTED
Definition:
roles.h:52
pcmk_role_stopped
Stopped.
Definition:
roles.h:36
pcmk_role_promoted
Promoted.
Definition:
roles.h:39
RSC_ROLE_MASTER
Definition:
roles.h:61
pcmk_parse_role
enum rsc_role_e pcmk_parse_role(const char *role)
Parse a resource role from a string role specification.
Definition:
roles.c:59
pcmk_role_unpromoted
Unpromoted.
Definition:
roles.h:38
rsc_role_e
rsc_role_e
Definition:
roles.h:34
RSC_ROLE_STARTED
Definition:
roles.h:49
pcmk_role_started
Started.
Definition:
roles.h:37
RSC_ROLE_SLAVE
Definition:
roles.h:55
RSC_ROLE_UNKNOWN
Definition:
roles.h:43
pcmk_role_unknown
Resource role is unknown.
Definition:
roles.h:35
Generated on Thu Aug 8 2024 18:08:10 for pacemaker by
1.8.14