root/include/crm/pengine/common.h

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

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. recovery2text

   1 /*
   2  * Copyright 2004-2023 the Pacemaker project contributors
   3  *
   4  * The version control history for this file may have further details.
   5  *
   6  * This source code is licensed under the GNU Lesser General Public License
   7  * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
   8  */
   9 
  10 #ifndef PCMK__CRM_PENGINE_COMMON__H
  11 #  define PCMK__CRM_PENGINE_COMMON__H
  12 
  13 #  include <glib.h>
  14 #  include <regex.h>
  15 #  include <crm/common/iso8601.h>
  16 #  include <crm/common/scheduler.h>
  17 
  18 #ifdef __cplusplus
  19 extern "C" {
  20 #endif
  21 
  22 extern gboolean was_processing_error;
  23 extern gboolean was_processing_warning;
  24 
  25 const char *task2text(enum action_tasks task);
  26 enum action_tasks text2task(const char *task);
  27 enum rsc_role_e text2role(const char *role);
  28 const char *role2text(enum rsc_role_e role);
  29 const char *fail2text(enum action_fail_response fail);
  30 
  31 const char *pe_pref(GHashTable * options, const char *name);
  32 
  33 /*!
  34  * \brief Get readable description of a recovery type
  35  *
  36  * \param[in] type  Recovery type
  37  *
  38  * \return Static string describing \p type
  39  */
  40 static inline const char *
  41 recovery2text(enum rsc_recovery_type type)
     /* [previous][next][first][last][top][bottom][index][help] */
  42 {
  43     switch (type) {
  44         case pcmk_multiply_active_stop:
  45             return "shutting it down";
  46         case pcmk_multiply_active_restart:
  47             return "attempting recovery";
  48         case pcmk_multiply_active_block:
  49             return "waiting for an administrator";
  50         case pcmk_multiply_active_unexpected:
  51             return "stopping unexpected instances";
  52     }
  53     return "Unknown";
  54 }
  55 
  56 typedef struct pe_re_match_data {
  57     char *string;
  58     int nregs;
  59     regmatch_t *pmatch;
  60 } pe_re_match_data_t;
  61 
  62 typedef struct pe_match_data {
  63     pe_re_match_data_t *re;
  64     GHashTable *params;
  65     GHashTable *meta;
  66 } pe_match_data_t;
  67 
  68 typedef struct pe_rsc_eval_data {
  69     const char *standard;
  70     const char *provider;
  71     const char *agent;
  72 } pe_rsc_eval_data_t;
  73 
  74 typedef struct pe_op_eval_data {
  75     const char *op_name;
  76     guint interval;
  77 } pe_op_eval_data_t;
  78 
  79 typedef struct pe_rule_eval_data {
  80     GHashTable *node_hash;          // Only used with g_hash_table_lookup()
  81     enum rsc_role_e role;
  82     crm_time_t *now;                // @COMPAT could be const
  83     pe_match_data_t *match_data;    // @COMPAT could be const
  84     pe_rsc_eval_data_t *rsc_data;   // @COMPAT could be const
  85     pe_op_eval_data_t *op_data;     // @COMPAT could be const
  86 } pe_rule_eval_data_t;
  87 
  88 #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
  89 #include <crm/pengine/common_compat.h>
  90 #endif
  91 
  92 #ifdef __cplusplus
  93 }
  94 #endif
  95 
  96 #endif

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