root/pengine/pengine.h

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

INCLUDED FROM


   1 /* 
   2  * Copyright (C) 2004 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 PENGINE__H
  19 #  define PENGINE__H
  20 
  21 typedef struct rsc_to_node_s rsc_to_node_t;
  22 typedef struct rsc_colocation_s rsc_colocation_t;
  23 typedef struct rsc_ticket_s rsc_ticket_t;
  24 typedef struct lrm_agent_s lrm_agent_t;
  25 typedef struct order_constraint_s order_constraint_t;
  26 
  27 #  include <glib.h>
  28 #  include <crm/crm.h>
  29 #  include <crm/common/iso8601.h>
  30 #  include <crm/pengine/rules.h>
  31 #  include <crm/pengine/common.h>
  32 #  include <crm/pengine/status.h>
  33 
  34 #  include <crm/pengine/complex.h>
  35 
  36 enum pe_stop_fail {
  37     pesf_block,
  38     pesf_stonith,
  39     pesf_ignore
  40 };
  41 
  42 enum pe_weights {
  43     pe_weights_none = 0x0,
  44     pe_weights_init = 0x1,
  45     pe_weights_forward = 0x4,
  46     pe_weights_positive = 0x8,
  47     pe_weights_rollback = 0x10,
  48 };
  49 
  50 struct rsc_colocation_s {
  51     const char *id;
  52     const char *node_attribute;
  53     resource_t *rsc_lh;
  54     resource_t *rsc_rh;
  55 
  56     int role_lh;
  57     int role_rh;
  58 
  59     int score;
  60 };
  61 
  62 enum loss_ticket_policy_e {
  63     loss_ticket_stop,
  64     loss_ticket_demote,
  65     loss_ticket_fence,
  66     loss_ticket_freeze
  67 };
  68 
  69 struct rsc_ticket_s {
  70     const char *id;
  71     resource_t *rsc_lh;
  72     ticket_t *ticket;
  73     enum loss_ticket_policy_e loss_policy;
  74 
  75     int role_lh;
  76 };
  77 
  78 struct rsc_to_node_s {
  79     char *id;
  80     resource_t *rsc_lh;
  81 
  82     enum rsc_role_e role_filter;
  83     enum pe_discover_e discover_mode;
  84     GListPtr node_list_rh;      /* node_t* */
  85 };
  86 
  87 struct order_constraint_s {
  88     int id;
  89     enum pe_ordering type;
  90 
  91     void *lh_opaque;
  92     resource_t *lh_rsc;
  93     action_t *lh_action;
  94     char *lh_action_task;
  95 
  96     void *rh_opaque;
  97     resource_t *rh_rsc;
  98     action_t *rh_action;
  99     char *rh_action_task;
 100 
 101     /* (soon to be) variant specific */
 102 /*              int   lh_rsc_incarnation; */
 103 /*              int   rh_rsc_incarnation; */
 104 };
 105 
 106 extern gboolean stage0(pe_working_set_t * data_set);
 107 extern gboolean probe_resources(pe_working_set_t * data_set);
 108 extern gboolean stage2(pe_working_set_t * data_set);
 109 extern gboolean stage3(pe_working_set_t * data_set);
 110 extern gboolean stage4(pe_working_set_t * data_set);
 111 extern gboolean stage5(pe_working_set_t * data_set);
 112 extern gboolean stage6(pe_working_set_t * data_set);
 113 extern gboolean stage7(pe_working_set_t * data_set);
 114 extern gboolean stage8(pe_working_set_t * data_set);
 115 
 116 extern gboolean summary(GListPtr resources);
 117 
 118 extern gboolean unpack_constraints(xmlNode * xml_constraints, pe_working_set_t * data_set);
 119 
 120 extern gboolean update_action_states(GListPtr actions);
 121 
 122 extern gboolean shutdown_constraints(node_t * node, action_t * shutdown_op,
 123                                      pe_working_set_t * data_set);
 124 
 125 extern gboolean stonith_constraints(node_t * node, action_t * stonith_op,
 126                                     pe_working_set_t * data_set);
 127 
 128 extern int custom_action_order(resource_t * lh_rsc, char *lh_task, action_t * lh_action,
 129                                resource_t * rh_rsc, char *rh_task, action_t * rh_action,
 130                                enum pe_ordering type, pe_working_set_t * data_set);
 131 
 132 extern int new_rsc_order(resource_t * lh_rsc, const char *lh_task,
 133                          resource_t * rh_rsc, const char *rh_task,
 134                          enum pe_ordering type, pe_working_set_t * data_set);
 135 
 136 #  define order_start_start(rsc1,rsc2, type)                            \
 137     new_rsc_order(rsc1, CRMD_ACTION_START, rsc2, CRMD_ACTION_START, type, data_set)
 138 #  define order_stop_stop(rsc1, rsc2, type)                             \
 139     new_rsc_order(rsc1, CRMD_ACTION_STOP, rsc2, CRMD_ACTION_STOP, type, data_set)
 140 
 141 extern void graph_element_from_action(action_t * action, pe_working_set_t * data_set);
 142 extern void add_maintenance_update(pe_working_set_t *data_set);
 143 
 144 extern gboolean show_scores;
 145 extern int scores_log_level;
 146 extern gboolean show_utilization;
 147 extern int utilization_log_level;
 148 extern const char *transition_idle_timeout;
 149 
 150 #endif

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