10#ifndef PCMK__CRM_STONITH_NG__H
11# define PCMK__CRM_STONITH_NG__H
61#if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
70#if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
293 const char *namespace_s,
const char *agent,
345 const char *namespace_s,
char **output,
int timeout_sec);
383 char **list_info,
int timeout);
415 const char *port,
int timeout);
529 int options,
void *user_data,
530 const char *callback_name,
571 const char *node,
const char *pattern,
572 const char *attr,
const char *value,
int level);
599 const char *node,
const char *pattern,
600 const char *attr,
const char *value,
int level,
623 const char *namespace_s,
const char *agent,
625 char **output,
char **error_output);
714#define STONITH_LIBRARY "libstonithd.so.56"
722stonith_api_kick_helper(uint32_t nodeid,
int timeout,
bool off)
724 static void *st_library = NULL;
727 if (st_library == NULL) {
730 if (st_library && st_kick_fn == NULL) {
731 st_kick_fn = (
st_api_kick_fn) dlsym(st_library,
"stonith_api_kick");
733 if (st_kick_fn == NULL) {
741 return (*st_kick_fn) (nodeid, NULL,
timeout, off);
746stonith_api_time_helper(uint32_t nodeid,
bool in_progress)
748 static void *st_library = NULL;
751 if (st_library == NULL) {
754 if (st_library && st_time_fn == NULL) {
755 st_time_fn = (
st_api_time_fn) dlsym(st_library,
"stonith_api_time");
757 if (st_time_fn == NULL) {
761 return (*st_time_fn) (nodeid, NULL, in_progress);
764#if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
785 const char *key,
const char *value);
814 const char *namespace_s);
#define PCMK_ALLOW_DEPRECATED
Allow use of deprecated Pacemaker APIs.
void stonith_api_delete(stonith_t *stonith)
const char * stonith_namespace2text(enum stonith_namespace st_namespace)
struct stonith_api_operations_s stonith_api_operations_t
Fencer API operations.
time_t stonith_api_time(uint32_t nodeid, const char *uname, bool in_progress)
struct stonith_callback_data_s stonith_callback_data_t
Data for an asynchronous fencing request callback.
enum stonith_namespace stonith_get_namespace(const char *agent, const char *namespace_s)
struct stonith_key_value_s stonith_key_value_t
Key-value pair list node.
enum stonith_namespace stonith_text2namespace(const char *namespace_s)
stonith_call_options
Flags that can be set in call options for API requests.
@ st_opt_allow_self_fencing
@ st_opt_report_only_success
void stonith_history_free(stonith_history_t *head)
const char * stonith_action_str(const char *action)
stonith_namespace
Supported fence agent interface standards.
int stonith_api_connect_retry(stonith_t *st, const char *name, int max_attempts)
time_t(* st_api_time_fn)(int nodeid, const char *uname, bool in_progress)
int stonith_api_kick(uint32_t nodeid, const char *uname, int timeout, bool off)
stonith_state
Fencer API connection state.
@ stonith_connected_command
@ stonith_connected_query
struct stonith_history_s stonith_history_t
Fencing history entry.
op_state
Fencing operation states.
bool stonith_dispatch(stonith_t *stonith_api)
struct stonith_event_s stonith_event_t
Fencing event.
stonith_t * stonith_api_new(void)
int(* st_api_kick_fn)(int nodeid, const char *uname, int timeout, bool off)
void stonith_key_value_freeall(stonith_key_value_t *head, int keys, int values)
bool stonith_agent_exists(const char *agent, int timeout)
void stonith_dump_pending_callbacks(stonith_t *stonith)
const char * stonith_op_state_str(enum op_state state)
stonith_key_value_t * stonith_key_value_add(stonith_key_value_t *kvp, const char *key, const char *value)
int(* fence_with_delay)(stonith_t *stonith, int call_options, const char *node, const char *action, int timeout, int tolerance, int delay)
Request delayed fencing of a target.
int(* register_level)(stonith_t *st, int options, const char *node, int level, const stonith_key_value_t *device_list)
Register a fencing level for specified node with local fencer.
int(* free)(stonith_t *st)
Destroy a fencer connection.
int(* register_callback)(stonith_t *stonith, int call_id, int timeout, int options, void *user_data, const char *callback_name, void(*callback)(stonith_t *st, stonith_callback_data_t *data))
Register a callback for an asynchronous fencing result.
int(* query)(stonith_t *stonith, int call_options, const char *target, stonith_key_value_t **devices, int timeout)
List registered fence devices.
int(* register_notification)(stonith_t *stonith, const char *event, void(*callback)(stonith_t *st, stonith_event_t *e))
Register a callback for fence notifications.
int(* connect)(stonith_t *st, const char *name, int *stonith_fd)
Connect to the local fencer.
int(* register_device)(stonith_t *st, int options, const char *id, const char *namespace_s, const char *agent, const stonith_key_value_t *params)
Register a fence device with the local fencer.
int(* remove_level)(stonith_t *st, int options, const char *node, int level)
Unregister a fencing level for specified node with local fencer.
int(* disconnect)(stonith_t *st)
Disconnect from the local stonith daemon.
int(* list)(stonith_t *stonith, int call_options, const char *id, char **list_info, int timeout)
Get the output of a fence device's list action.
int(* remove_callback)(stonith_t *stonith, int call_id, bool all_callbacks)
Unregister callbacks for asynchronous fencing results.
int(* remove_level_full)(stonith_t *st, int options, const char *node, const char *pattern, const char *attr, const char *value, int level)
Unregister fencing level for specified node, pattern or attribute.
int(* fence)(stonith_t *stonith, int call_options, const char *node, const char *action, int timeout, int tolerance)
Request that a target get fenced.
int(* list_agents)(stonith_t *stonith, int call_options, const char *namespace_s, stonith_key_value_t **devices, int timeout)
Retrieve a list of installed fence agents.
int(* confirm)(stonith_t *stonith, int call_options, const char *target)
Manually confirm that a node has been fenced.
int(* status)(stonith_t *stonith, int call_options, const char *id, const char *port, int timeout)
Check whether a fence device target is reachable by status action.
int(* register_level_full)(stonith_t *st, int options, const char *node, const char *pattern, const char *attr, const char *value, int level, const stonith_key_value_t *device_list)
Register fencing level for specified node, pattern or attribute.
int(* validate)(stonith_t *st, int call_options, const char *rsc_id, const char *namespace_s, const char *agent, const stonith_key_value_t *params, int timeout, char **output, char **error_output)
Validate an arbitrary stonith device configuration.
int(* monitor)(stonith_t *stonith, int call_options, const char *id, int timeout)
Check whether a fence device is reachable by monitor action.
int(* remove_notification)(stonith_t *stonith, const char *event)
Unregister callbacks for fence notifications.
int(* remove_device)(stonith_t *st, int options, const char *name)
Unregister a fence device with the local fencer.
int(* history)(stonith_t *stonith, int call_options, const char *node, stonith_history_t **history, int timeout)
List fencing actions that have occurred for a target.
int(* metadata)(stonith_t *stonith, int call_options, const char *agent, const char *namespace_s, char **output, int timeout_sec)
Retrieve a fence agent's metadata.
Data for an asynchronous fencing request callback.
struct stonith_history_s * next
Key-value pair list node.
struct stonith_key_value_s * next
Fencer API connection object.
stonith_api_operations_t * cmds