root/include/crm/common/actions_internal.h

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

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. pcmk__readable_action

   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_COMMON_ACTIONS_INTERNAL__H
  11 #define PCMK__CRM_COMMON_ACTIONS_INTERNAL__H
  12 
  13 #include <stdbool.h>                        // bool
  14 #include <glib.h>                           // guint
  15 #include <libxml/tree.h>                    // xmlNode
  16 
  17 #include <crm/common/actions.h>             // PCMK_ACTION_MONITOR
  18 #include <crm/common/strings_internal.h>    // pcmk__str_eq()
  19 
  20 #ifdef __cplusplus
  21 extern "C" {
  22 #endif
  23 
  24 //! printf-style format to create operation key from resource, action, interval
  25 #define PCMK__OP_FMT "%s_%s_%u"
  26 
  27 char *pcmk__op_key(const char *rsc_id, const char *op_type, guint interval_ms);
  28 char *pcmk__notify_key(const char *rsc_id, const char *notify_type,
  29                        const char *op_type);
  30 char *pcmk__transition_key(int transition_id, int action_id, int target_rc,
  31                            const char *node);
  32 void pcmk__filter_op_for_digest(xmlNode *param_set);
  33 bool pcmk__is_fencing_action(const char *action);
  34 
  35 /*!
  36  * \internal
  37  * \brief Get a human-friendly action name
  38  *
  39  * \param[in] action_name  Actual action name
  40  * \param[in] interval_ms  Action interval (in milliseconds)
  41  *
  42  * \return Action name suitable for display
  43  */
  44 static inline const char *
  45 pcmk__readable_action(const char *action_name, guint interval_ms) {
     /* [previous][next][first][last][top][bottom][index][help] */
  46     if ((interval_ms == 0)
  47         && pcmk__str_eq(action_name, PCMK_ACTION_MONITOR, pcmk__str_none)) {
  48         return "probe";
  49     }
  50     return action_name;
  51 }
  52 
  53 #ifdef __cplusplus
  54 }
  55 #endif
  56 
  57 #endif // PCMK__CRM_COMMON_ACTIONS_INTERNAL__H

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