root/lib/pengine/pe_status_private.h

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

INCLUDED FROM


   1 /*
   2  * Copyright 2018-2024 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__PENGINE_PE_STATUS_PRIVATE__H
  11 #define PCMK__PENGINE_PE_STATUS_PRIVATE__H
  12 
  13 /* This header is for the sole use of libpe_status, so that functions can be
  14  * declared with G_GNUC_INTERNAL for efficiency.
  15  */
  16 
  17 #include <glib.h>                 // G_GNUC_INTERNAL, GSList, GList, etc.
  18 #include <libxml/tree.h>          // xmlNode
  19 
  20 #include <crm/common/digest_internal.h>     // pcmk__op_digest_t
  21 #include <crm/common/scheduler_types.h>     // pcmk_action_t, etc.
  22 
  23 #ifdef __cplusplus
  24 extern "C" {
  25 #endif
  26 
  27 #if defined(PCMK__UNIT_TESTING)
  28 #undef G_GNUC_INTERNAL
  29 #define G_GNUC_INTERNAL
  30 #endif
  31 
  32 typedef struct notify_data_s {
  33     GSList *keys;               // Environment variable name/value pairs
  34 
  35     const char *action;
  36 
  37     pcmk_action_t *pre;
  38     pcmk_action_t *post;
  39     pcmk_action_t *pre_done;
  40     pcmk_action_t *post_done;
  41 
  42     GList *active;            /* notify_entry_t*  */
  43     GList *inactive;          /* notify_entry_t*  */
  44     GList *start;             /* notify_entry_t*  */
  45     GList *stop;              /* notify_entry_t*  */
  46     GList *demote;            /* notify_entry_t*  */
  47     GList *promote;           /* notify_entry_t*  */
  48     GList *promoted;          /* notify_entry_t*  */
  49     GList *unpromoted;        /* notify_entry_t*  */
  50     GHashTable *allowed_nodes;
  51 } notify_data_t;
  52 
  53 G_GNUC_INTERNAL
  54 pcmk_resource_t *pe__create_clone_child(pcmk_resource_t *rsc,
  55                                         pcmk_scheduler_t *scheduler);
  56 
  57 G_GNUC_INTERNAL
  58 void pe__create_action_notifications(pcmk_resource_t *rsc,
  59                                      notify_data_t *n_data);
  60 
  61 G_GNUC_INTERNAL
  62 void pe__free_action_notification_data(notify_data_t *n_data);
  63 
  64 G_GNUC_INTERNAL
  65 notify_data_t *pe__action_notif_pseudo_ops(pcmk_resource_t *rsc,
  66                                            const char *task,
  67                                            pcmk_action_t *action,
  68                                            pcmk_action_t *complete);
  69 
  70 G_GNUC_INTERNAL
  71 void pe__force_anon(const char *standard, pcmk_resource_t *rsc, const char *rid,
  72                     pcmk_scheduler_t *scheduler);
  73 
  74 G_GNUC_INTERNAL
  75 gint pe__cmp_rsc_priority(gconstpointer a, gconstpointer b);
  76 
  77 G_GNUC_INTERNAL
  78 gboolean pe__unpack_resource(xmlNode *xml_obj, pcmk_resource_t **rsc,
  79                              pcmk_resource_t *parent,
  80                              pcmk_scheduler_t *scheduler);
  81 
  82 G_GNUC_INTERNAL
  83 gboolean unpack_remote_nodes(xmlNode *xml_resources,
  84                              pcmk_scheduler_t *scheduler);
  85 
  86 G_GNUC_INTERNAL
  87 gboolean unpack_resources(const xmlNode *xml_resources,
  88                           pcmk_scheduler_t *scheduler);
  89 
  90 G_GNUC_INTERNAL
  91 void pcmk__validate_fencing_topology(const xmlNode *xml);
  92 
  93 G_GNUC_INTERNAL
  94 gboolean unpack_config(xmlNode *config, pcmk_scheduler_t *scheduler);
  95 
  96 G_GNUC_INTERNAL
  97 gboolean unpack_nodes(xmlNode *xml_nodes, pcmk_scheduler_t *scheduler);
  98 
  99 G_GNUC_INTERNAL
 100 gboolean unpack_tags(xmlNode *xml_tags, pcmk_scheduler_t *scheduler);
 101 
 102 G_GNUC_INTERNAL
 103 gboolean unpack_status(xmlNode *status, pcmk_scheduler_t *scheduler);
 104 
 105 G_GNUC_INTERNAL
 106 pcmk__op_digest_t *pe__compare_fencing_digest(pcmk_resource_t *rsc,
 107                                               const char *agent,
 108                                               pcmk_node_t *node,
 109                                               pcmk_scheduler_t *scheduler);
 110 
 111 G_GNUC_INTERNAL
 112 void pe__unpack_node_health_scores(pcmk_scheduler_t *scheduler);
 113 
 114 // Primitive resource methods
 115 
 116 G_GNUC_INTERNAL
 117 unsigned int pe__primitive_max_per_node(const pcmk_resource_t *rsc);
 118 
 119 // Group resource methods
 120 
 121 G_GNUC_INTERNAL
 122 unsigned int pe__group_max_per_node(const pcmk_resource_t *rsc);
 123 
 124 // Clone resource methods
 125 
 126 G_GNUC_INTERNAL
 127 unsigned int pe__clone_max_per_node(const pcmk_resource_t *rsc);
 128 
 129 // Bundle resource methods
 130 
 131 G_GNUC_INTERNAL
 132 pcmk_node_t *pe__bundle_active_node(const pcmk_resource_t *rsc,
 133                                     unsigned int *count_all,
 134                                     unsigned int *count_clean);
 135 
 136 G_GNUC_INTERNAL
 137 unsigned int pe__bundle_max_per_node(const pcmk_resource_t *rsc);
 138 
 139 #ifdef __cplusplus
 140 }
 141 #endif
 142 
 143 #endif  // PCMK__PENGINE_PE_STATUS_PRIVATE__H

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