pacemaker  2.1.8-3980678f03
Scalable High-Availability cluster resource manager
health.c
Go to the documentation of this file.
1 /*
2  * Copyright 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 #include <crm_internal.h>
11 
20 bool
22 {
23  return pcmk__strcase_any_of(value,
29  NULL);
30 }
31 
41 pcmk__parse_health_strategy(const char *value)
42 {
43  if (pcmk__str_eq(value, PCMK_VALUE_NONE,
46  }
47  if (pcmk__str_eq(value, PCMK_VALUE_MIGRATE_ON_RED, pcmk__str_casei)) {
49  }
50  if (pcmk__str_eq(value, PCMK_VALUE_ONLY_GREEN, pcmk__str_casei)) {
52  }
53  if (pcmk__str_eq(value, PCMK_VALUE_PROGRESSIVE, pcmk__str_casei)) {
55  }
56  if (pcmk__str_eq(value, PCMK_VALUE_CUSTOM, pcmk__str_casei)) {
58  } else {
59  pcmk__config_err("Using default of \"" PCMK_VALUE_NONE "\" for "
61  " because '%s' is not a valid value",
62  value);
64  }
65 }
bool pcmk__strcase_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
Definition: strings.c:1026
#define pcmk__config_err(fmt...)
#define PCMK_VALUE_NONE
Definition: options.h:178
#define PCMK_VALUE_ONLY_GREEN
Definition: options.h:185
enum pcmk__health_strategy pcmk__parse_health_strategy(const char *value)
Definition: health.c:41
#define PCMK_VALUE_CUSTOM
Definition: options.h:140
#define PCMK_OPT_NODE_HEALTH_STRATEGY
Definition: options.h:51
pcmk__health_strategy
#define PCMK_VALUE_PROGRESSIVE
Definition: options.h:194
#define PCMK_VALUE_MIGRATE_ON_RED
Definition: options.h:171
bool pcmk__validate_health_strategy(const char *value)
Definition: health.c:21