pacemaker
2.1.5-b7adf64e51
Scalable High-Availability cluster resource manager
lib
common
health.c
Go to the documentation of this file.
1
/*
2
* Copyright 2022 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
#include <
crm_internal.h
>
11
20
bool
21
pcmk__validate_health_strategy
(
const
char
*value)
22
{
23
return
pcmk__strcase_any_of
(value,
24
PCMK__VALUE_NONE
,
25
PCMK__VALUE_CUSTOM
,
26
PCMK__VALUE_ONLY_GREEN
,
27
PCMK__VALUE_PROGRESSIVE
,
28
PCMK__VALUE_MIGRATE_ON_RED
,
29
NULL);
30
}
31
40
enum
pcmk__health_strategy
41
pcmk__parse_health_strategy
(
const
char
*value)
42
{
43
if
(pcmk__str_eq(value,
PCMK__VALUE_NONE
,
44
pcmk__str_null_matches
|
pcmk__str_casei
)) {
45
return
pcmk__health_strategy_none
;
46
47
}
else
if
(pcmk__str_eq(value,
PCMK__VALUE_MIGRATE_ON_RED
,
48
pcmk__str_casei
)) {
49
return
pcmk__health_strategy_no_red
;
50
51
}
else
if
(pcmk__str_eq(value,
PCMK__VALUE_ONLY_GREEN
,
52
pcmk__str_casei
)) {
53
return
pcmk__health_strategy_only_green
;
54
55
}
else
if
(pcmk__str_eq(value,
PCMK__VALUE_PROGRESSIVE
,
56
pcmk__str_casei
)) {
57
return
pcmk__health_strategy_progressive
;
58
59
}
else
if
(pcmk__str_eq(value,
PCMK__VALUE_CUSTOM
,
60
pcmk__str_casei
)) {
61
return
pcmk__health_strategy_custom
;
62
63
}
else
{
64
pcmk__config_err
(
"Using default of \""
PCMK__VALUE_NONE
"\" for "
65
PCMK__OPT_NODE_HEALTH_STRATEGY
66
" because '%s' is not a valid value"
,
67
value);
68
return
pcmk__health_strategy_none
;
69
}
70
}
PCMK__VALUE_MIGRATE_ON_RED
#define PCMK__VALUE_MIGRATE_ON_RED
Definition:
options_internal.h:151
pcmk__strcase_any_of
bool pcmk__strcase_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
Definition:
strings.c:928
pcmk__config_err
#define pcmk__config_err(fmt...)
Definition:
logging_internal.h:24
PCMK__VALUE_NONE
#define PCMK__VALUE_NONE
Definition:
options_internal.h:152
pcmk__str_null_matches
Definition:
strings_internal.h:27
PCMK__VALUE_ONLY_GREEN
#define PCMK__VALUE_ONLY_GREEN
Definition:
options_internal.h:154
pcmk__health_strategy_no_red
Definition:
health_internal.h:26
crm_internal.h
pcmk__str_casei
Definition:
strings_internal.h:26
pcmk__parse_health_strategy
enum pcmk__health_strategy pcmk__parse_health_strategy(const char *value)
Definition:
health.c:41
pcmk__health_strategy_progressive
Definition:
health_internal.h:28
PCMK__OPT_NODE_HEALTH_STRATEGY
#define PCMK__OPT_NODE_HEALTH_STRATEGY
Definition:
options_internal.h:141
PCMK__VALUE_PROGRESSIVE
#define PCMK__VALUE_PROGRESSIVE
Definition:
options_internal.h:155
pcmk__health_strategy_none
Definition:
health_internal.h:25
pcmk__health_strategy
pcmk__health_strategy
Definition:
health_internal.h:24
pcmk__health_strategy_only_green
Definition:
health_internal.h:27
pcmk__health_strategy_custom
Definition:
health_internal.h:29
PCMK__VALUE_CUSTOM
#define PCMK__VALUE_CUSTOM
Definition:
options_internal.h:148
pcmk__validate_health_strategy
bool pcmk__validate_health_strategy(const char *value)
Definition:
health.c:21
Generated on Thu Dec 8 2022 10:06:23 for pacemaker by
1.8.14