pacemaker  2.0.4-2deceaa
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
internal.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011-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 STONITH_NG_INTERNAL__H
11 # define STONITH_NG_INTERNAL__H
12 
13 # include <glib.h>
14 # include <crm/common/ipc.h>
15 # include <crm/common/output.h>
16 # include <crm/common/xml.h>
17 
19 {
25 };
26 
27 struct stonith_action_s;
28 typedef struct stonith_action_s stonith_action_t;
29 
30 stonith_action_t *stonith_action_create(const char *agent,
31  const char *_action,
32  const char *victim,
33  uint32_t victim_nodeid,
34  int timeout,
35  GHashTable * device_args,
36  GHashTable * port_map,
37  const char * host_arg);
39 void stonith__action_result(stonith_action_t *action, int *rc, char **output,
40  char **error_output);
41 
42 int
44  void *userdata,
45  void (*done) (GPid pid, int rc, const char *output,
46  gpointer user_data),
47  void (*fork_cb) (GPid pid, gpointer user_data));
48 
50 
51 xmlNode *create_level_registration_xml(const char *node, const char *pattern,
52  const char *attr, const char *value,
53  int level,
54  stonith_key_value_t *device_list);
55 
56 xmlNode *create_device_registration_xml(const char *id,
57  enum stonith_namespace namespace,
58  const char *agent,
59  stonith_key_value_t *params,
60  const char *rsc_provides);
61 
63 
64 GList *stonith__parse_targets(const char *hosts);
65 
66 gboolean stonith__later_succeeded(stonith_history_t *event, stonith_history_t *top_history);
68 
69 long long stonith__device_parameter_flags(xmlNode *metadata);
70 
71 # define ST_LEVEL_MAX 10
72 
73 # define F_STONITH_CLIENTID "st_clientid"
74 # define F_STONITH_CALLOPTS "st_callopt"
75 # define F_STONITH_CALLID "st_callid"
76 # define F_STONITH_CALLDATA "st_calldata"
77 # define F_STONITH_OPERATION "st_op"
78 # define F_STONITH_TARGET "st_target"
79 # define F_STONITH_REMOTE_OP_ID "st_remote_op"
80 # define F_STONITH_REMOTE_OP_ID_RELAY "st_remote_op_relay"
81 # define F_STONITH_RC "st_rc"
82 
83 # define F_STONITH_TIMEOUT "st_timeout"
84 # define F_STONITH_TOLERANCE "st_tolerance"
85 # define F_STONITH_DELAY "st_delay"
86 
87 # define F_STONITH_ACTION_TIMEOUT "st_action_timeout"
88 
89 # define F_STONITH_ACTION_DISALLOWED "st_action_disallowed"
90 
91 # define F_STONITH_DELAY_MAX "st_delay_max"
92 
93 # define F_STONITH_DELAY_BASE "st_delay_base"
94 
96 # define F_STONITH_DEVICE_VERIFIED "st_monitor_verified"
97 
98 # define F_STONITH_DEVICE_REQUIRED "st_required"
99 
100 # define F_STONITH_AVAILABLE_DEVICES "st-available-devices"
101 # define F_STONITH_CALLBACK_TOKEN "st_async_id"
102 # define F_STONITH_CLIENTNAME "st_clientname"
103 # define F_STONITH_CLIENTNODE "st_clientnode"
104 # define F_STONITH_NOTIFY_ACTIVATE "st_notify_activate"
105 # define F_STONITH_NOTIFY_DEACTIVATE "st_notify_deactivate"
106 # define F_STONITH_DELEGATE "st_delegate"
107 
111 # define F_STONITH_ORIGIN "st_origin"
112 # define F_STONITH_HISTORY_LIST "st_history"
113 # define F_STONITH_DATE "st_date"
114 # define F_STONITH_STATE "st_state"
115 # define F_STONITH_ACTIVE "st_active"
116 # define F_STONITH_DIFFERENTIAL "st_differential"
117 
118 # define F_STONITH_DEVICE "st_device_id"
119 # define F_STONITH_ACTION "st_device_action"
120 # define F_STONITH_MODE "st_mode"
121 # define F_STONITH_MERGED "st_op_merged"
122 
123 # define T_STONITH_NG "stonith-ng"
124 # define T_STONITH_REPLY "st-reply"
125 
128 # define T_STONITH_TIMEOUT_VALUE "st-async-timeout-value"
129 # define T_STONITH_NOTIFY "st_notify"
130 
131 # define STONITH_ATTR_HOSTARG "pcmk_host_argument"
132 # define STONITH_ATTR_HOSTMAP "pcmk_host_map"
133 # define STONITH_ATTR_HOSTLIST "pcmk_host_list"
134 # define STONITH_ATTR_HOSTCHECK "pcmk_host_check"
135 # define STONITH_ATTR_DELAY_MAX "pcmk_delay_max"
136 # define STONITH_ATTR_DELAY_BASE "pcmk_delay_base"
137 # define STONITH_ATTR_ACTION_LIMIT "pcmk_action_limit"
138 
139 # define STONITH_ATTR_ACTION_OP "action"
140 
141 # define STONITH_OP_EXEC "st_execute"
142 # define STONITH_OP_TIMEOUT_UPDATE "st_timeout_update"
143 # define STONITH_OP_QUERY "st_query"
144 # define STONITH_OP_FENCE "st_fence"
145 # define STONITH_OP_RELAY "st_relay"
146 # define STONITH_OP_DEVICE_ADD "st_device_register"
147 # define STONITH_OP_DEVICE_DEL "st_device_remove"
148 # define STONITH_OP_FENCE_HISTORY "st_fence_history"
149 # define STONITH_OP_LEVEL_ADD "st_level_add"
150 # define STONITH_OP_LEVEL_DEL "st_level_remove"
151 
152 # define STONITH_WATCHDOG_AGENT "#watchdog"
153 
154 # ifdef HAVE_STONITH_STONITH_H
155 // utilities from st_lha.c
157 int stonith__lha_metadata(const char *agent, int timeout, char **output);
158 bool stonith__agent_is_lha(const char *agent);
159 int stonith__lha_validate(stonith_t *st, int call_options, const char *target,
160  const char *agent, GHashTable *params,
161  int timeout, char **output, char **error_output);
162 # endif
163 
164 // utilities from st_rhcs.c
166 int stonith__rhcs_metadata(const char *agent, int timeout, char **output);
167 bool stonith__agent_is_rhcs(const char *agent);
168 int stonith__rhcs_validate(stonith_t *st, int call_options, const char *target,
169  const char *agent, GHashTable *params, const char *host_arg,
170  int timeout, char **output, char **error_output);
171 
172 int stonith__failed_history(pcmk__output_t *out, va_list args);
173 int stonith__history(pcmk__output_t *out, va_list args);
174 int stonith__full_history(pcmk__output_t *out, va_list args);
175 int stonith__full_history_xml(pcmk__output_t *out, va_list args);
176 int stonith__last_fenced_html(pcmk__output_t *out, va_list args);
177 int stonith__last_fenced_text(pcmk__output_t *out, va_list args);
178 int stonith__last_fenced_xml(pcmk__output_t *out, va_list args);
179 int stonith__pending_actions(pcmk__output_t *out, va_list args);
180 int stonith__event_html(pcmk__output_t *out, va_list args);
181 int stonith__event_text(pcmk__output_t *out, va_list args);
182 int stonith__event_xml(pcmk__output_t *out, va_list args);
183 int stonith__validate_agent_html(pcmk__output_t *out, va_list args);
184 int stonith__validate_agent_text(pcmk__output_t *out, va_list args);
185 int stonith__validate_agent_xml(pcmk__output_t *out, va_list args);
186 
187 #endif
int stonith__last_fenced_text(pcmk__output_t *out, va_list args)
Definition: st_output.c:209
void stonith__destroy_action(stonith_action_t *action)
Definition: st_client.c:595
struct stonith_action_s stonith_action_t
Definition: internal.h:28
void stonith__action_result(stonith_action_t *action, int *rc, char **output, char **error_output)
Definition: st_client.c:626
int stonith__event_text(pcmk__output_t *out, va_list args)
Definition: st_output.c:332
Formatted output for pacemaker tools.
int stonith__rhcs_metadata(const char *agent, int timeout, char **output)
Execute RHCS-compatible agent&#39;s meta-data action.
Definition: st_rhcs.c:205
void stonith__register_messages(pcmk__output_t *out)
Definition: st_output.c:525
int stonith__execute(stonith_action_t *action)
Definition: st_client.c:905
xmlNode * create_level_registration_xml(const char *node, const char *pattern, const char *attr, const char *value, int level, stonith_key_value_t *device_list)
Definition: st_client.c:393
int stonith__lha_validate(stonith_t *st, int call_options, const char *target, const char *agent, GHashTable *params, int timeout, char **output, char **error_output)
Definition: st_lha.c:274
stonith_history_t * stonith__sort_history(stonith_history_t *history)
Definition: st_client.c:2578
int stonith__full_history(pcmk__output_t *out, va_list args)
Definition: st_output.c:114
int stonith__lha_metadata(const char *agent, int timeout, char **output)
Definition: st_lha.c:175
stonith_action_t * stonith_action_create(const char *agent, const char *_action, const char *victim, uint32_t victim_nodeid, int timeout, GHashTable *device_args, GHashTable *port_map, const char *host_arg)
Definition: st_client.c:655
stonith_namespace
Definition: stonith-ng.h:75
uint32_t pid
Definition: internal.h:81
int stonith__last_fenced_xml(pcmk__output_t *out, va_list args)
Definition: st_output.c:224
int stonith_action_execute_async(stonith_action_t *action, void *userdata, void(*done)(GPid pid, int rc, const char *output, gpointer user_data), void(*fork_cb)(GPid pid, gpointer user_data))
Definition: st_client.c:878
const char * action
Definition: pcmk_fence.c:29
int stonith__list_lha_agents(stonith_key_value_t **devices)
Definition: st_lha.c:106
GList * stonith__parse_targets(const char *hosts)
Definition: st_client.c:2507
st_device_flags
Definition: internal.h:18
bool stonith__agent_is_rhcs(const char *agent)
Definition: st_rhcs.c:231
stonith_t * st
Definition: pcmk_fence.c:27
int rc
Definition: pcmk_fence.c:34
int stonith__validate_agent_xml(pcmk__output_t *out, va_list args)
Definition: st_output.c:469
int stonith__full_history_xml(pcmk__output_t *out, va_list args)
Definition: st_output.c:151
gboolean stonith__later_succeeded(stonith_history_t *event, stonith_history_t *top_history)
Definition: st_client.c:2547
int stonith__validate_agent_html(pcmk__output_t *out, va_list args)
Definition: st_output.c:416
int stonith__event_html(pcmk__output_t *out, va_list args)
Definition: st_output.c:284
Wrappers for and extensions to libxml2.
int stonith__rhcs_validate(stonith_t *st, int call_options, const char *target, const char *agent, GHashTable *params, const char *host_arg, int timeout, char **output, char **error_output)
Definition: st_rhcs.c:242
int stonith__history(pcmk__output_t *out, va_list args)
Definition: st_output.c:73
const char * target
Definition: pcmk_fence.c:28
int stonith__list_rhcs_agents(stonith_key_value_t **devices)
Definition: st_rhcs.c:31
long long stonith__device_parameter_flags(xmlNode *metadata)
Definition: st_client.c:2635
This structure contains everything that makes up a single output formatter.
Definition: output.h:153
int stonith__event_xml(pcmk__output_t *out, va_list args)
Definition: st_output.c:370
int stonith__failed_history(pcmk__output_t *out, va_list args)
Definition: st_output.c:34
int stonith__validate_agent_text(pcmk__output_t *out, va_list args)
Definition: st_output.c:441
Wrappers for and extensions to libqb IPC.
bool stonith__agent_is_lha(const char *agent)
Determine namespace of a fence agent.
Definition: st_lha.c:79
int stonith__pending_actions(pcmk__output_t *out, va_list args)
Definition: st_output.c:244
unsigned int timeout
Definition: pcmk_fence.c:31
int stonith__last_fenced_html(pcmk__output_t *out, va_list args)
Definition: st_output.c:193
xmlNode * create_device_registration_xml(const char *id, enum stonith_namespace namespace, const char *agent, stonith_key_value_t *params, const char *rsc_provides)
Definition: st_client.c:273