root/include/crm/common/nodes.h

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

INCLUDED FROM


   1 /*
   2  * Copyright 2004-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__CRM_COMMON_NODES__H
  11 #define PCMK__CRM_COMMON_NODES__H
  12 
  13 #include <stdbool.h>                    // bool
  14 #include <glib.h>                       // gboolean, GList, GHashTable
  15 #include <libxml/tree.h>                // xmlNode
  16 
  17 #include <crm/common/scheduler_types.h> // pcmk_resource_t, pcmk_scheduler_t
  18 
  19 #ifdef __cplusplus
  20 extern "C" {
  21 #endif
  22 
  23 /*!
  24  * \file
  25  * \brief Scheduler API for nodes
  26  * \ingroup core
  27  */
  28 
  29 // Special node attributes
  30 
  31 #define PCMK_NODE_ATTR_MAINTENANCE          "maintenance"
  32 #define PCMK_NODE_ATTR_STANDBY              "standby"
  33 #define PCMK_NODE_ATTR_TERMINATE            "terminate"
  34 
  35 
  36 //! \internal Do not use
  37 typedef struct pcmk__node_private pcmk__node_private_t;
  38 
  39 // Basic node information (all node objects for the same node share this)
  40 // @COMPAT Drop this struct once all members are moved to pcmk__node_private_t
  41 //!@{
  42 //! \deprecated Do not use (public access will be removed in a future release)
  43 struct pcmk__node_details {
  44     /* @COMPAT Convert these gbooleans into new enum pcmk__node_flags values
  45      * when we no longer support versions of sbd that use them
  46      */
  47 
  48     // NOTE: sbd (as of at least 1.5.2) uses this
  49     //! \deprecated Call pcmk_node_is_online() instead
  50     gboolean online;            // Whether online
  51 
  52     // NOTE: sbd (as of at least 1.5.2) uses this
  53     //! \deprecated Call pcmk_node_is_pending() instead
  54     gboolean pending;           // Whether controller membership is pending
  55 
  56     // NOTE: sbd (as of at least 1.5.2) uses this
  57     //! \deprecated Call !pcmk_node_is_clean() instead
  58     gboolean unclean;           // Whether node requires fencing
  59 
  60     // NOTE: sbd (as of at least 1.5.2) uses this
  61     //! \deprecated Call pcmk_node_is_shutting_down() instead
  62     gboolean shutdown;          // Whether shutting down
  63 
  64     // NOTE: sbd (as of at least 1.5.2) uses this
  65     //! \deprecated Call pcmk_node_is_in_maintenance() instead
  66     gboolean maintenance;       // Whether in maintenance mode
  67 
  68     // NOTE: sbd (as of at least 1.5.2) uses this
  69     // \deprecated Call pcmk_foreach_active_resource() instead
  70     GList *running_rsc;             // List of resources active on node
  71 };
  72 //!@}
  73 
  74 // Implementation of pcmk_node_t
  75 // @COMPAT Make contents internal when we can break API backward compatibility
  76 //!@{
  77 //! \deprecated Do not use (public access will be removed in a future release)
  78 struct pcmk__scored_node {
  79     struct pcmk__node_assignment *assign;
  80 
  81     // NOTE: sbd (as of at least 1.5.2) uses this
  82     struct pcmk__node_details *details;   // Basic node information
  83 
  84     //! \internal Do not use
  85     pcmk__node_private_t *priv;
  86 };
  87 //!@}
  88 
  89 bool pcmk_node_is_online(const pcmk_node_t *node);
  90 bool pcmk_node_is_pending(const pcmk_node_t *node);
  91 bool pcmk_node_is_clean(const pcmk_node_t *node);
  92 bool pcmk_node_is_shutting_down(const pcmk_node_t *node);
  93 bool pcmk_node_is_in_maintenance(const pcmk_node_t *node);
  94 
  95 bool pcmk_foreach_active_resource(pcmk_node_t *node,
  96                                   bool (*fn)(pcmk_resource_t *, void *),
  97                                   void *user_data);
  98 
  99 const char *pcmk_cib_node_shutdown(xmlNode *cib, const char *node);
 100 
 101 #ifdef __cplusplus
 102 }
 103 #endif
 104 
 105 #endif // PCMK__CRM_COMMON_NODES__H

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