pacemaker  2.1.6-802a72226b
Scalable High-Availability cluster resource manager
pe_status_private.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018-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 PE_STATUS_PRIVATE__H
11 # define 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 #if defined(PCMK__UNIT_TESTING)
18 #undef G_GNUC_INTERNAL
19 #define G_GNUC_INTERNAL
20 #endif
21 
26 # define status_print(fmt, args...) \
27  if(options & pe_print_html) { \
28  FILE *stream = print_data; \
29  fprintf(stream, fmt, ##args); \
30  } else if(options & pe_print_printf || options & pe_print_ncurses) { \
31  FILE *stream = print_data; \
32  fprintf(stream, fmt, ##args); \
33  } else if(options & pe_print_xml) { \
34  FILE *stream = print_data; \
35  fprintf(stream, fmt, ##args); \
36  } else if(options & pe_print_log) { \
37  int log_level = *(int*)print_data; \
38  do_crm_log(log_level, fmt, ##args); \
39  }
40 
41 typedef struct notify_data_s {
42  GSList *keys; // Environment variable name/value pairs
43 
44  const char *action;
45 
50 
51  GList *active; /* notify_entry_t* */
52  GList *inactive; /* notify_entry_t* */
53  GList *start; /* notify_entry_t* */
54  GList *stop; /* notify_entry_t* */
55  GList *demote; /* notify_entry_t* */
56  GList *promote; /* notify_entry_t* */
57  GList *promoted; /* notify_entry_t* */
58  GList *unpromoted; /* notify_entry_t* */
59  GHashTable *allowed_nodes;
61 
62 G_GNUC_INTERNAL
65 
66 G_GNUC_INTERNAL
68 
69 G_GNUC_INTERNAL
71 
72 G_GNUC_INTERNAL
75  pe_action_t *complete);
76 
77 G_GNUC_INTERNAL
78 void pe__force_anon(const char *standard, pe_resource_t *rsc, const char *rid,
80 
81 G_GNUC_INTERNAL
82 gint pe__cmp_rsc_priority(gconstpointer a, gconstpointer b);
83 
84 G_GNUC_INTERNAL
85 gboolean pe__unpack_resource(xmlNode *xml_obj, pe_resource_t **rsc,
87 
88 G_GNUC_INTERNAL
89 gboolean unpack_remote_nodes(xmlNode *xml_resources, pe_working_set_t *data_set);
90 
91 G_GNUC_INTERNAL
92 gboolean unpack_resources(const xmlNode *xml_resources,
94 
95 G_GNUC_INTERNAL
96 gboolean unpack_config(xmlNode *config, pe_working_set_t *data_set);
97 
98 G_GNUC_INTERNAL
99 gboolean unpack_nodes(xmlNode *xml_nodes, pe_working_set_t *data_set);
100 
101 G_GNUC_INTERNAL
102 gboolean unpack_tags(xmlNode *xml_tags, pe_working_set_t *data_set);
103 
104 G_GNUC_INTERNAL
105 gboolean unpack_status(xmlNode *status, pe_working_set_t *data_set);
106 
107 G_GNUC_INTERNAL
109  const char *agent,
110  pe_node_t *node,
112 
113 G_GNUC_INTERNAL
115 
116 G_GNUC_INTERNAL
118  unsigned int *count_all,
119  unsigned int *count_clean);
120 
121 #endif // PE_STATUS_PRIVATE__H
G_GNUC_INTERNAL void pe__unpack_node_health_scores(pe_working_set_t *data_set)
Definition: pe_health.c:23
G_GNUC_INTERNAL notify_data_t * pe__action_notif_pseudo_ops(pe_resource_t *rsc, const char *task, pe_action_t *action, pe_action_t *complete)
Definition: pe_notif.c:431
G_GNUC_INTERNAL gboolean unpack_remote_nodes(xmlNode *xml_resources, pe_working_set_t *data_set)
Definition: unpack.c:630
GHashTable * allowed_nodes
G_GNUC_INTERNAL gboolean pe__unpack_resource(xmlNode *xml_obj, pe_resource_t **rsc, pe_resource_t *parent, pe_working_set_t *data_set)
Definition: complex.c:590
G_GNUC_INTERNAL gboolean unpack_status(xmlNode *status, pe_working_set_t *data_set)
Definition: unpack.c:1262
const char * action
Definition: pcmk_fence.c:30
G_GNUC_INTERNAL pe_resource_t * pe__create_clone_child(pe_resource_t *rsc, pe_working_set_t *data_set)
Definition: clone.c:244
G_GNUC_INTERNAL gboolean unpack_tags(xmlNode *xml_tags, pe_working_set_t *data_set)
Definition: unpack.c:834
G_GNUC_INTERNAL void pe__create_action_notifications(pe_resource_t *rsc, notify_data_t *n_data)
Definition: pe_notif.c:932
G_GNUC_INTERNAL pe_node_t * pe__bundle_active_node(const pe_resource_t *rsc, unsigned int *count_all, unsigned int *count_clean)
Definition: bundle.c:1932
G_GNUC_INTERNAL gboolean unpack_nodes(xmlNode *xml_nodes, pe_working_set_t *data_set)
Definition: unpack.c:555
pe_action_t * post
pe_working_set_t * data_set
pe_action_t * post_done
G_GNUC_INTERNAL gint pe__cmp_rsc_priority(gconstpointer a, gconstpointer b)
Definition: utils.c:335
G_GNUC_INTERNAL void pe__force_anon(const char *standard, pe_resource_t *rsc, const char *rid, pe_working_set_t *data_set)
Definition: clone.c:209
const char * parent
Definition: cib.c:25
struct notify_data_s notify_data_t
const char * action
G_GNUC_INTERNAL gboolean unpack_config(xmlNode *config, pe_working_set_t *data_set)
Definition: unpack.c:214
G_GNUC_INTERNAL void pe__free_action_notification_data(notify_data_t *n_data)
Definition: pe_notif.c:949
pe_action_t * pre_done
G_GNUC_INTERNAL op_digest_cache_t * pe__compare_fencing_digest(pe_resource_t *rsc, const char *agent, pe_node_t *node, pe_working_set_t *data_set)
Definition: pe_digest.c:533
pe_action_t * pre
G_GNUC_INTERNAL gboolean unpack_resources(const xmlNode *xml_resources, pe_working_set_t *data_set)
Definition: unpack.c:767