pacemaker  2.0.2-debe490
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 <crm/common/ipc.h>
14 # include <crm/common/output.h>
15 # include <crm/common/xml.h>
16 
17 struct stonith_action_s;
18 typedef struct stonith_action_s stonith_action_t;
19 
20 stonith_action_t *stonith_action_create(const char *agent,
21  const char *_action,
22  const char *victim,
23  uint32_t victim_nodeid,
24  int timeout,
25  GHashTable * device_args, GHashTable * port_map);
27 void stonith__action_result(stonith_action_t *action, int *rc, char **output,
28  char **error_output);
29 
30 int
32  void *userdata,
33  void (*done) (GPid pid, int rc, const char *output,
34  gpointer user_data),
35  void (*fork_cb) (GPid pid, gpointer user_data));
36 
38 
39 xmlNode *create_level_registration_xml(const char *node, const char *pattern,
40  const char *attr, const char *value,
41  int level,
42  stonith_key_value_t *device_list);
43 
44 xmlNode *create_device_registration_xml(const char *id,
45  enum stonith_namespace namespace,
46  const char *agent,
47  stonith_key_value_t *params,
48  const char *rsc_provides);
49 
51 
52 # define ST_LEVEL_MAX 10
53 
54 # define F_STONITH_CLIENTID "st_clientid"
55 # define F_STONITH_CALLOPTS "st_callopt"
56 # define F_STONITH_CALLID "st_callid"
57 # define F_STONITH_CALLDATA "st_calldata"
58 # define F_STONITH_OPERATION "st_op"
59 # define F_STONITH_TARGET "st_target"
60 # define F_STONITH_REMOTE_OP_ID "st_remote_op"
61 # define F_STONITH_RC "st_rc"
62 
63 # define F_STONITH_TIMEOUT "st_timeout"
64 # define F_STONITH_TOLERANCE "st_tolerance"
65 
66 # define F_STONITH_ACTION_TIMEOUT "st_action_timeout"
67 
68 # define F_STONITH_ACTION_DISALLOWED "st_action_disallowed"
69 
70 # define F_STONITH_DELAY_MAX "st_delay_max"
71 
72 # define F_STONITH_DELAY_BASE "st_delay_base"
73 
75 # define F_STONITH_DEVICE_VERIFIED "st_monitor_verified"
76 
77 # define F_STONITH_DEVICE_REQUIRED "st_required"
78 
79 # define F_STONITH_AVAILABLE_DEVICES "st-available-devices"
80 # define F_STONITH_CALLBACK_TOKEN "st_async_id"
81 # define F_STONITH_CLIENTNAME "st_clientname"
82 # define F_STONITH_CLIENTNODE "st_clientnode"
83 # define F_STONITH_NOTIFY_ACTIVATE "st_notify_activate"
84 # define F_STONITH_NOTIFY_DEACTIVATE "st_notify_deactivate"
85 # define F_STONITH_DELEGATE "st_delegate"
86 
90 # define F_STONITH_ORIGIN "st_origin"
91 # define F_STONITH_HISTORY_LIST "st_history"
92 # define F_STONITH_DATE "st_date"
93 # define F_STONITH_STATE "st_state"
94 # define F_STONITH_ACTIVE "st_active"
95 # define F_STONITH_DIFFERENTIAL "st_differential"
96 
97 # define F_STONITH_DEVICE "st_device_id"
98 # define F_STONITH_ACTION "st_device_action"
99 # define F_STONITH_MODE "st_mode"
100 
101 # define T_STONITH_NG "stonith-ng"
102 # define T_STONITH_REPLY "st-reply"
103 
106 # define T_STONITH_TIMEOUT_VALUE "st-async-timeout-value"
107 # define T_STONITH_NOTIFY "st_notify"
108 
109 # define STONITH_ATTR_HOSTARG "pcmk_host_argument"
110 # define STONITH_ATTR_HOSTMAP "pcmk_host_map"
111 # define STONITH_ATTR_HOSTLIST "pcmk_host_list"
112 # define STONITH_ATTR_HOSTCHECK "pcmk_host_check"
113 # define STONITH_ATTR_DELAY_MAX "pcmk_delay_max"
114 # define STONITH_ATTR_DELAY_BASE "pcmk_delay_base"
115 # define STONITH_ATTR_ACTION_LIMIT "pcmk_action_limit"
116 
117 # define STONITH_ATTR_ACTION_OP "action"
118 
119 # define STONITH_OP_EXEC "st_execute"
120 # define STONITH_OP_TIMEOUT_UPDATE "st_timeout_update"
121 # define STONITH_OP_QUERY "st_query"
122 # define STONITH_OP_FENCE "st_fence"
123 # define STONITH_OP_RELAY "st_relay"
124 # define STONITH_OP_DEVICE_ADD "st_device_register"
125 # define STONITH_OP_DEVICE_DEL "st_device_remove"
126 # define STONITH_OP_FENCE_HISTORY "st_fence_history"
127 # define STONITH_OP_LEVEL_ADD "st_level_add"
128 # define STONITH_OP_LEVEL_DEL "st_level_remove"
129 
130 # define STONITH_WATCHDOG_AGENT "#watchdog"
131 
132 # ifdef HAVE_STONITH_STONITH_H
133 // utilities from st_lha.c
135 int stonith__lha_metadata(const char *agent, int timeout, char **output);
136 bool stonith__agent_is_lha(const char *agent);
137 int stonith__lha_validate(stonith_t *st, int call_options, const char *target,
138  const char *agent, GHashTable *params,
139  int timeout, char **output, char **error_output);
140 # endif
141 
142 // utilities from st_rhcs.c
144 int stonith__rhcs_metadata(const char *agent, int timeout, char **output);
145 bool stonith__agent_is_rhcs(const char *agent);
146 int stonith__rhcs_validate(stonith_t *st, int call_options, const char *target,
147  const char *agent, GHashTable *params,
148  int timeout, char **output, char **error_output);
149 
150 #endif
void stonith__destroy_action(stonith_action_t *action)
Definition: st_client.c:549
struct stonith_action_s stonith_action_t
Definition: internal.h:18
void stonith__action_result(stonith_action_t *action, int *rc, char **output, char **error_output)
Definition: st_client.c:580
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:98
void stonith__register_messages(pcmk__output_t *out)
Definition: st_output.c:232
int stonith__execute(stonith_action_t *action)
Definition: st_client.c:856
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:357
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:251
int stonith__lha_metadata(const char *agent, int timeout, char **output)
Definition: st_lha.c:152
stonith_namespace
Definition: stonith-ng.h:74
uint32_t pid
Definition: internal.h:83
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:829
int stonith__list_lha_agents(stonith_key_value_t **devices)
Definition: st_lha.c:84
bool stonith__agent_is_rhcs(const char *agent)
Definition: st_rhcs.c:181
Wrappers for and extensions to libxml2.
int stonith__list_rhcs_agents(stonith_key_value_t **devices)
Definition: st_rhcs.c:31
This structure contains everything that makes up a single output formatter.
Definition: output.h:124
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:57
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)
Definition: st_client.c:609
int stonith__rhcs_validate(stonith_t *st, int call_options, const char *target, const char *agent, GHashTable *params, int timeout, char **output, char **error_output)
Definition: st_rhcs.c:192
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:237