root/include/crm/fencing/internal.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   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 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 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
  35 stonith_action_execute_async(stonith_action_t * action,
  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, const char *pattern,
  46                                        const char *attr, const char *value,
  47                                        int level,
  48                                        stonith_key_value_t *device_list);
  49 
  50 xmlNode *create_device_registration_xml(const char *id, const char *namespace, const char *agent,
  51                                         stonith_key_value_t * params, const char *rsc_provides);
  52 
  53 #  define ST_LEVEL_MAX 10
  54 
  55 #  define F_STONITH_CLIENTID      "st_clientid"
  56 #  define F_STONITH_CALLOPTS      "st_callopt"
  57 #  define F_STONITH_CALLID        "st_callid"
  58 #  define F_STONITH_CALLDATA      "st_calldata"
  59 #  define F_STONITH_OPERATION     "st_op"
  60 #  define F_STONITH_TARGET        "st_target"
  61 #  define F_STONITH_REMOTE_OP_ID  "st_remote_op"
  62 #  define F_STONITH_RC            "st_rc"
  63 /*! Timeout period per a device execution */
  64 #  define F_STONITH_TIMEOUT       "st_timeout"
  65 #  define F_STONITH_TOLERANCE     "st_tolerance"
  66 /*! Action specific timeout period returned in query of fencing devices. */
  67 #  define F_STONITH_ACTION_TIMEOUT       "st_action_timeout"
  68 /*! Host in query result is not allowed to run this action */
  69 #  define F_STONITH_ACTION_DISALLOWED     "st_action_disallowed"
  70 /*! Maximum of random fencing delay for a device */
  71 #  define F_STONITH_DELAY_MAX            "st_delay_max"
  72 /*! Base delay used for a fencing delay */
  73 #  define F_STONITH_DELAY_BASE           "st_delay_base"
  74 /*! Has this device been verified using a monitor type
  75  *  operation (monitor, list, status) */
  76 #  define F_STONITH_DEVICE_VERIFIED   "st_monitor_verified"
  77 /*! device is required for this action */
  78 #  define F_STONITH_DEVICE_REQUIRED   "st_required"
  79 /*! number of available devices in query result */
  80 #  define F_STONITH_AVAILABLE_DEVICES "st-available-devices"
  81 #  define F_STONITH_CALLBACK_TOKEN    "st_async_id"
  82 #  define F_STONITH_CLIENTNAME        "st_clientname"
  83 #  define F_STONITH_CLIENTNODE        "st_clientnode"
  84 #  define F_STONITH_NOTIFY_TYPE       "st_notify_type"
  85 #  define F_STONITH_NOTIFY_ACTIVATE   "st_notify_activate"
  86 #  define F_STONITH_NOTIFY_DEACTIVATE "st_notify_deactivate"
  87 #  define F_STONITH_DELEGATE      "st_delegate"
  88 /*! The node initiating the stonith operation.  If an operation
  89  * is relayed, this is the last node the operation lands on. When
  90  * in standalone mode, origin is the client's id that originated the
  91  * operation. */
  92 #  define F_STONITH_ORIGIN        "st_origin"
  93 #  define F_STONITH_HISTORY_LIST  "st_history"
  94 #  define F_STONITH_DATE          "st_date"
  95 #  define F_STONITH_STATE         "st_state"
  96 #  define F_STONITH_ACTIVE        "st_active"
  97 
  98 #  define F_STONITH_DEVICE        "st_device_id"
  99 #  define F_STONITH_ACTION        "st_device_action"
 100 #  define F_STONITH_MODE          "st_mode"
 101 
 102 #  define T_STONITH_NG        "stonith-ng"
 103 #  define T_STONITH_REPLY     "st-reply"
 104 /*! For async operations, an event from the server containing
 105  * the total amount of time the server is allowing for the operation
 106  * to take place is returned to the client. */
 107 #  define T_STONITH_TIMEOUT_VALUE "st-async-timeout-value"
 108 #  define T_STONITH_NOTIFY    "st_notify"
 109 
 110 #  define STONITH_ATTR_ARGMAP    "pcmk_arg_map"
 111 #  define STONITH_ATTR_HOSTARG   "pcmk_host_argument"
 112 #  define STONITH_ATTR_HOSTMAP   "pcmk_host_map"
 113 #  define STONITH_ATTR_HOSTLIST  "pcmk_host_list"
 114 #  define STONITH_ATTR_HOSTCHECK "pcmk_host_check"
 115 #  define STONITH_ATTR_DELAY_MAX "pcmk_delay_max"
 116 #  define STONITH_ATTR_DELAY_BASE   "pcmk_delay_base"
 117 #  define STONITH_ATTR_ACTION_LIMIT "pcmk_action_limit"
 118 
 119 #  define STONITH_ATTR_ACTION_OP   "action"
 120 
 121 #  define STONITH_OP_EXEC        "st_execute"
 122 #  define STONITH_OP_TIMEOUT_UPDATE        "st_timeout_update"
 123 #  define STONITH_OP_QUERY       "st_query"
 124 #  define STONITH_OP_FENCE       "st_fence"
 125 #  define STONITH_OP_RELAY       "st_relay"
 126 #  define STONITH_OP_CONFIRM     "st_confirm"
 127 #  define STONITH_OP_DEVICE_ADD      "st_device_register"
 128 #  define STONITH_OP_DEVICE_DEL      "st_device_remove"
 129 #  define STONITH_OP_DEVICE_METADATA "st_device_metadata"
 130 #  define STONITH_OP_FENCE_HISTORY   "st_fence_history"
 131 #  define STONITH_OP_LEVEL_ADD       "st_level_add"
 132 #  define STONITH_OP_LEVEL_DEL       "st_level_remove"
 133 
 134 #  define stonith_channel            "st_command"
 135 #  define stonith_channel_callback   "st_callback"
 136 
 137 #  define STONITH_WATCHDOG_AGENT  "#watchdog"
 138 
 139 #endif

/* [previous][next][first][last][top][bottom][index][help] */