This source file includes following definitions.
- recovery2text
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 #ifndef PE_COMMON__H
  11 #  define PE_COMMON__H
  12 
  13 #ifdef __cplusplus
  14 extern "C" {
  15 #endif
  16 
  17 #  include <glib.h>
  18 #  include <regex.h>
  19 
  20 #  include <crm/common/iso8601.h>
  21 
  22 extern gboolean was_processing_error;
  23 extern gboolean was_processing_warning;
  24 
  25 
  26 
  27 
  28 
  29 
  30 
  31 
  32 
  33 
  34 enum action_fail_response {
  35     action_fail_ignore,     
  36     
  37     action_fail_recover,    
  38     
  39     
  40     action_fail_migrate,    
  41     action_fail_block,      
  42     action_fail_stop,       
  43     action_fail_standby,    
  44     action_fail_fence,      
  45 
  46     
  47 
  48     action_fail_restart_container,
  49 
  50     
  51 
  52 
  53 
  54 
  55 
  56     action_fail_reset_remote,
  57 
  58     action_fail_demote,
  59 };
  60 
  61 
  62 enum action_tasks {
  63     no_action,
  64     monitor_rsc,
  65     stop_rsc,
  66     stopped_rsc,
  67     start_rsc,
  68     started_rsc,
  69     action_notify,
  70     action_notified,
  71     action_promote,
  72     action_promoted,
  73     action_demote,
  74     action_demoted,
  75     shutdown_crm,
  76     stonith_node
  77 };
  78 
  79 enum rsc_recovery_type {
  80     recovery_stop_start,
  81     recovery_stop_only,
  82     recovery_block
  83 };
  84 
  85 enum rsc_start_requirement {
  86     rsc_req_nothing,            
  87     rsc_req_quorum,             
  88     rsc_req_stonith             
  89 };
  90 
  91 
  92 enum rsc_role_e {
  93     RSC_ROLE_UNKNOWN    = 0,
  94     RSC_ROLE_STOPPED    = 1,
  95     RSC_ROLE_STARTED    = 2,
  96     RSC_ROLE_UNPROMOTED = 3,
  97     RSC_ROLE_PROMOTED   = 4,
  98 
  99 #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
 100     
 101     RSC_ROLE_SLAVE      = RSC_ROLE_UNPROMOTED,
 102 
 103     
 104     RSC_ROLE_MASTER     = RSC_ROLE_PROMOTED,
 105 #endif
 106 };
 107 
 108 #  define RSC_ROLE_MAX  (RSC_ROLE_PROMOTED + 1)
 109 
 110 #  define RSC_ROLE_UNKNOWN_S "Unknown"
 111 #  define RSC_ROLE_STOPPED_S "Stopped"
 112 #  define RSC_ROLE_STARTED_S "Started"
 113 #  define RSC_ROLE_UNPROMOTED_S         "Unpromoted"
 114 #  define RSC_ROLE_PROMOTED_S           "Promoted"
 115 #  define RSC_ROLE_UNPROMOTED_LEGACY_S  "Slave"
 116 #  define RSC_ROLE_PROMOTED_LEGACY_S    "Master"
 117 
 118 
 119 enum pe_print_options {
 120     pe_print_log            = (1 << 0),
 121     pe_print_html           = (1 << 1),
 122     pe_print_ncurses        = (1 << 2),
 123     pe_print_printf         = (1 << 3),
 124     pe_print_dev            = (1 << 4),  
 125     pe_print_details        = (1 << 5),  
 126     pe_print_max_details    = (1 << 6),  
 127     pe_print_rsconly        = (1 << 7),
 128     pe_print_ops            = (1 << 8),
 129     pe_print_suppres_nl     = (1 << 9),
 130     pe_print_xml            = (1 << 10),
 131     pe_print_brief          = (1 << 11),
 132     pe_print_pending        = (1 << 12),
 133     pe_print_clone_details  = (1 << 13),
 134     pe_print_clone_active   = (1 << 14), 
 135     pe_print_implicit       = (1 << 15)  
 136 };
 137 
 138 const char *task2text(enum action_tasks task);
 139 enum action_tasks text2task(const char *task);
 140 enum rsc_role_e text2role(const char *role);
 141 const char *role2text(enum rsc_role_e role);
 142 const char *fail2text(enum action_fail_response fail);
 143 
 144 const char *pe_pref(GHashTable * options, const char *name);
 145 void calculate_active_ops(GList * sorted_op_list, int *start_index, int *stop_index);
 146 
 147 static inline const char *
 148 recovery2text(enum rsc_recovery_type type)
     
 149 {
 150     switch (type) {
 151         case recovery_stop_only:
 152             return "shutting it down";
 153         case recovery_stop_start:
 154             return "attempting recovery";
 155         case recovery_block:
 156             return "waiting for an administrator";
 157     }
 158     return "Unknown";
 159 }
 160 
 161 typedef struct pe_re_match_data {
 162     char *string;
 163     int nregs;
 164     regmatch_t *pmatch;
 165 } pe_re_match_data_t;
 166 
 167 typedef struct pe_match_data {
 168     pe_re_match_data_t *re;
 169     GHashTable *params;
 170     GHashTable *meta;
 171 } pe_match_data_t;
 172 
 173 typedef struct pe_rsc_eval_data {
 174     const char *standard;
 175     const char *provider;
 176     const char *agent;
 177 } pe_rsc_eval_data_t;
 178 
 179 typedef struct pe_op_eval_data {
 180     const char *op_name;
 181     guint interval;
 182 } pe_op_eval_data_t;
 183 
 184 typedef struct pe_rule_eval_data {
 185     GHashTable *node_hash;
 186     enum rsc_role_e role;
 187     crm_time_t *now;
 188     pe_match_data_t *match_data;
 189     pe_rsc_eval_data_t *rsc_data;
 190     pe_op_eval_data_t *op_data;
 191 } pe_rule_eval_data_t;
 192 
 193 #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
 194 #include <crm/pengine/common_compat.h>
 195 #endif
 196 
 197 #ifdef __cplusplus
 198 }
 199 #endif
 200 
 201 #endif