pacemaker  1.1.18-7fdfbbe
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 (C) 2004 Andrew Beekhof <andrew@beekhof.net>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This software is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 #ifndef PE_COMMON__H
19 # define PE_COMMON__H
20 # include <glib.h>
21 
22 extern gboolean was_processing_error;
23 extern gboolean was_processing_warning;
24 
25 /* order is significant here
26  * items listed in order of accending severeness
27  * more severe actions take precedent over lower ones
28  */
32  action_fail_migrate, /* recover by moving it somewhere else */
38  /* This is reserved for internal use for baremetal remote node connection
39  * resources. This fail action means
40  * 1. If stonith is enabled, fence the baremetal remote node
41  * 2. stonith not enabled, attempt to recover the connection resources
42  *
43  * This response value gives us control of saying types of
44  * connection resource failures result in fencing the remote node.
45  * Example: recurring monitors failure should result in fencing.
46  */
48 
49 };
50 
51 /* the "done" action must be the "pre" action +1 */
67 };
68 
73 };
74 
76  rsc_req_nothing, /* Allowed by custom_action() */
77  rsc_req_quorum, /* Enforced by custom_action() */
78  rsc_req_stonith /* Enforced by native_start_constraints() */
79 };
80 
81 enum rsc_role_e {
87 };
88 
89 # define RSC_ROLE_MAX RSC_ROLE_MASTER+1
90 
91 # define RSC_ROLE_UNKNOWN_S "Unknown"
92 # define RSC_ROLE_STOPPED_S "Stopped"
93 # define RSC_ROLE_STARTED_S "Started"
94 # define RSC_ROLE_SLAVE_S "Slave"
95 # define RSC_ROLE_MASTER_S "Master"
96 
98  pe_print_log = 0x0001,
99  pe_print_html = 0x0002,
101  pe_print_printf = 0x0008,
102  pe_print_dev = 0x0010,
106  pe_print_ops = 0x0100,
108  pe_print_xml = 0x0400,
109  pe_print_brief = 0x0800,
112  pe_print_clone_active = 0x4000, // Print clone instances only if active
113  pe_print_implicit = 0x8000, // Print implicitly created resources
114 };
115 
116 const char *task2text(enum action_tasks task);
117 enum action_tasks text2task(const char *task);
118 enum rsc_role_e text2role(const char *role);
119 const char *role2text(enum rsc_role_e role);
120 const char *fail2text(enum action_fail_response fail);
121 
122 const char *pe_pref(GHashTable * options, const char *name);
123 void calculate_active_ops(GList * sorted_op_list, int *start_index, int *stop_index);
124 
125 static inline const char *
126 recovery2text(enum rsc_recovery_type type)
127 {
128  switch (type) {
129  case recovery_stop_only:
130  return "shutting it down";
131  case recovery_stop_start:
132  return "attempting recovery";
133  case recovery_block:
134  return "waiting for an administrator";
135  }
136  return "Unknown";
137 }
138 
139 #endif
const char * task2text(enum action_tasks task)
Definition: common.c:293
enum action_tasks text2task(const char *task)
Definition: common.c:233
const char * pe_pref(GHashTable *options, const char *name)
Definition: common.c:190
action_fail_response
Definition: common.h:29
const char * role2text(enum rsc_role_e role)
Definition: common.c:346
rsc_recovery_type
Definition: common.h:69
void calculate_active_ops(GList *sorted_op_list, int *start_index, int *stop_index)
Definition: unpack.c:2140
rsc_start_requirement
Definition: common.h:75
pe_print_options
Definition: common.h:97
enum rsc_role_e text2role(const char *role)
Definition: common.c:367
const char * fail2text(enum action_fail_response fail)
Definition: common.c:196
rsc_role_e
Definition: common.h:81
gboolean was_processing_error
Definition: common.c:28
gboolean was_processing_warning
Definition: common.c:29
action_tasks
Definition: common.h:52
enum crm_ais_msg_types type
Definition: internal.h:51