pacemaker  2.0.4-2deceaa
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
common.h
Go to the documentation of this file.
1 /*
2  * Copyright 2004-2019 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 PE_COMMON__H
11 # define PE_COMMON__H
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 # include <glib.h>
18 
19 extern gboolean was_processing_error;
20 extern gboolean was_processing_warning;
21 
22 /* order is significant here
23  * items listed in order of accending severeness
24  * more severe actions take precedent over lower ones
25  */
29  action_fail_migrate, /* recover by moving it somewhere else */
35 
36  /* This is reserved for internal use for remote node connection resources.
37  * Fence the remote node if stonith is enabled, otherwise attempt to recover
38  * the connection resource. This allows us to specify types of connection
39  * resource failures that should result in fencing the remote node
40  * (for example, recurring monitor failures).
41  */
43 
44 };
45 
46 /* the "done" action must be the "pre" action +1 */
62 };
63 
68 };
69 
71  rsc_req_nothing, /* Allowed by custom_action() */
72  rsc_req_quorum, /* Enforced by custom_action() */
73  rsc_req_stonith /* Enforced by native_start_constraints() */
74 };
75 
76 enum rsc_role_e {
82 };
83 
84 # define RSC_ROLE_MAX RSC_ROLE_MASTER+1
85 
86 # define RSC_ROLE_UNKNOWN_S "Unknown"
87 # define RSC_ROLE_STOPPED_S "Stopped"
88 # define RSC_ROLE_STARTED_S "Started"
89 # define RSC_ROLE_SLAVE_S "Slave"
90 # define RSC_ROLE_MASTER_S "Master"
91 
93  pe_print_log = 0x0001,
94  pe_print_html = 0x0002,
95  pe_print_ncurses = 0x0004,
96  pe_print_printf = 0x0008,
97  pe_print_dev = 0x0010, // Debugging (@COMPAT probably not useful)
98  pe_print_details = 0x0020,
101  pe_print_ops = 0x0100,
103  pe_print_xml = 0x0400,
104  pe_print_brief = 0x0800,
107  pe_print_clone_active = 0x4000, // Print clone instances only if active
108  pe_print_implicit = 0x8000, // Print implicitly created resources
109 };
110 
111 const char *task2text(enum action_tasks task);
112 enum action_tasks text2task(const char *task);
113 enum rsc_role_e text2role(const char *role);
114 const char *role2text(enum rsc_role_e role);
115 const char *fail2text(enum action_fail_response fail);
116 
117 const char *pe_pref(GHashTable * options, const char *name);
118 void calculate_active_ops(GList * sorted_op_list, int *start_index, int *stop_index);
119 
120 static inline const char *
121 recovery2text(enum rsc_recovery_type type)
122 {
123  switch (type) {
124  case recovery_stop_only:
125  return "shutting it down";
126  case recovery_stop_start:
127  return "attempting recovery";
128  case recovery_block:
129  return "waiting for an administrator";
130  }
131  return "Unknown";
132 }
133 
134 #ifdef __cplusplus
135 }
136 #endif
137 
138 #endif
const char * task2text(enum action_tasks task)
Definition: common.c:410
enum action_tasks text2task(const char *task)
Definition: common.c:358
const char * pe_pref(GHashTable *options, const char *name)
Definition: common.c:315
action_fail_response
Definition: common.h:26
const char * role2text(enum rsc_role_e role)
Definition: common.c:463
rsc_recovery_type
Definition: common.h:64
void calculate_active_ops(GList *sorted_op_list, int *start_index, int *stop_index)
Definition: unpack.c:2140
rsc_start_requirement
Definition: common.h:70
pe_print_options
Definition: common.h:92
enum rsc_role_e text2role(const char *role)
Definition: common.c:484
const char * fail2text(enum action_fail_response fail)
Definition: common.c:321
rsc_role_e
Definition: common.h:76
gboolean was_processing_error
Definition: common.c:20
char * name
Definition: pcmk_fence.c:30
gboolean was_processing_warning
Definition: common.c:21
action_tasks
Definition: common.h:47
enum crm_ais_msg_types type
Definition: internal.h:83