pacemaker  1.1.12-561c4cf
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
internal.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2011 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 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 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 STONITH_NG_INTERNAL__H
19 # define STONITH_NG_INTERNAL__H
20 
21 # include <crm/common/ipc.h>
22 # include <crm/common/xml.h>
23 
24 struct stonith_action_s;
25 typedef struct stonith_action_s stonith_action_t;
26 
27 stonith_action_t *stonith_action_create(const char *agent,
28  const char *_action,
29  const char *victim,
30  uint32_t victim_nodeid,
31  int timeout,
32  GHashTable * device_args, GHashTable * port_map);
33 
34 GPid
36  void *userdata,
37  void (*done) (GPid pid, int rc, const char *output,
38  gpointer user_data));
39 
40 int
41  stonith_action_execute(stonith_action_t * action, int *agent_result, char **output);
42 
43 gboolean is_redhat_agent(const char *agent);
44 
45 xmlNode *create_level_registration_xml(const char *node, int level,
46  stonith_key_value_t * device_list);
47 
48 xmlNode *create_device_registration_xml(const char *id, const char *namespace, const char *agent,
49  stonith_key_value_t * params, const char *rsc_provides);
50 
51 # define ST_LEVEL_MAX 10
52 
53 # define F_STONITH_CLIENTID "st_clientid"
54 # define F_STONITH_CALLOPTS "st_callopt"
55 # define F_STONITH_CALLID "st_callid"
56 # define F_STONITH_CALLDATA "st_calldata"
57 # define F_STONITH_OPERATION "st_op"
58 # define F_STONITH_TARGET "st_target"
59 # define F_STONITH_REMOTE_OP_ID "st_remote_op"
60 # define F_STONITH_RC "st_rc"
61 
62 # define F_STONITH_TIMEOUT "st_timeout"
63 # define F_STONITH_TOLERANCE "st_tolerance"
64 
65 # define F_STONITH_ACTION_TIMEOUT "st_action_timeout"
66 
68 # define F_STONITH_DEVICE_VERIFIED "st_monitor_verified"
69 
70 # define F_STONITH_DEVICE_REQUIRED "st_required"
71 # define F_STONITH_CALLBACK_TOKEN "st_async_id"
72 # define F_STONITH_CLIENTNAME "st_clientname"
73 # define F_STONITH_CLIENTNODE "st_clientnode"
74 # define F_STONITH_NOTIFY_TYPE "st_notify_type"
75 # define F_STONITH_NOTIFY_ACTIVATE "st_notify_activate"
76 # define F_STONITH_NOTIFY_DEACTIVATE "st_notify_deactivate"
77 # define F_STONITH_DELEGATE "st_delegate"
78 
82 # define F_STONITH_ORIGIN "st_origin"
83 # define F_STONITH_HISTORY_LIST "st_history"
84 # define F_STONITH_DATE "st_date"
85 # define F_STONITH_STATE "st_state"
86 # define F_STONITH_LEVEL "st_level"
87 # define F_STONITH_ACTIVE "st_active"
88 
89 # define F_STONITH_DEVICE "st_device_id"
90 # define F_STONITH_ACTION "st_device_action"
91 # define F_STONITH_MODE "st_mode"
92 
93 # define T_STONITH_NG "stonith-ng"
94 # define T_STONITH_REPLY "st-reply"
95 
98 # define T_STONITH_TIMEOUT_VALUE "st-async-timeout-value"
99 # define T_STONITH_NOTIFY "st_notify"
100 
101 # define STONITH_ATTR_ARGMAP "pcmk_arg_map"
102 # define STONITH_ATTR_HOSTARG "pcmk_host_argument"
103 # define STONITH_ATTR_HOSTMAP "pcmk_host_map"
104 # define STONITH_ATTR_HOSTLIST "pcmk_host_list"
105 # define STONITH_ATTR_HOSTCHECK "pcmk_host_check"
106 
107 # define STONITH_ATTR_ACTION_OP "action"
108 
109 # define STONITH_OP_EXEC "st_execute"
110 # define STONITH_OP_TIMEOUT_UPDATE "st_timeout_update"
111 # define STONITH_OP_QUERY "st_query"
112 # define STONITH_OP_FENCE "st_fence"
113 # define STONITH_OP_RELAY "st_relay"
114 # define STONITH_OP_CONFIRM "st_confirm"
115 # define STONITH_OP_DEVICE_ADD "st_device_register"
116 # define STONITH_OP_DEVICE_DEL "st_device_remove"
117 # define STONITH_OP_DEVICE_METADATA "st_device_metadata"
118 # define STONITH_OP_FENCE_HISTORY "st_fence_history"
119 # define STONITH_OP_LEVEL_ADD "st_level_add"
120 # define STONITH_OP_LEVEL_DEL "st_level_remove"
121 
122 # define stonith_channel "st_command"
123 # define stonith_channel_callback "st_callback"
124 
125 #endif
struct stonith_action_s stonith_action_t
Definition: internal.h:25
xmlNode * create_level_registration_xml(const char *node, int level, stonith_key_value_t *device_list)
gboolean is_redhat_agent(const char *agent)
uint32_t pid
Definition: internal.h:49
Wrappers for and extensions to libxml2.
xmlNode * create_device_registration_xml(const char *id, const char *namespace, const char *agent, stonith_key_value_t *params, const char *rsc_provides)
GPid stonith_action_execute_async(stonith_action_t *action, void *userdata, void(*done)(GPid pid, int rc, const char *output, gpointer user_data))
Wrappers for and extensions to libqb IPC.
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)
int stonith_action_execute(stonith_action_t *action, int *agent_result, char **output)