pacemaker 2.1.8-2.1.8
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
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
22#include <glib.h> // GSList, GList, GHashTable
23#include <libxml/tree.h> // xmlNode
24
25#include <crm/pengine/status.h> // pcmk_action_t, pcmk_resource_t, etc.
26
31# define status_print(fmt, args...) \
32 if(options & pe_print_html) { \
33 FILE *stream = print_data; \
34 fprintf(stream, fmt, ##args); \
35 } else if(options & pe_print_printf || options & pe_print_ncurses) { \
36 FILE *stream = print_data; \
37 fprintf(stream, fmt, ##args); \
38 } else if(options & pe_print_xml) { \
39 FILE *stream = print_data; \
40 fprintf(stream, fmt, ##args); \
41 } else if(options & pe_print_log) { \
42 int log_level = *(int*)print_data; \
43 do_crm_log(log_level, fmt, ##args); \
44 }
45
46typedef struct notify_data_s {
47 GSList *keys; // Environment variable name/value pairs
48
49 const char *action;
50
55
56 GList *active; /* notify_entry_t* */
57 GList *inactive; /* notify_entry_t* */
58 GList *start; /* notify_entry_t* */
59 GList *stop; /* notify_entry_t* */
60 GList *demote; /* notify_entry_t* */
61 GList *promote; /* notify_entry_t* */
62 GList *promoted; /* notify_entry_t* */
63 GList *unpromoted; /* notify_entry_t* */
64 GHashTable *allowed_nodes;
66
67G_GNUC_INTERNAL
70
71G_GNUC_INTERNAL
73 notify_data_t *n_data);
74
75G_GNUC_INTERNAL
77
78G_GNUC_INTERNAL
80 const char *task,
82 pcmk_action_t *complete);
83
84G_GNUC_INTERNAL
85void pe__force_anon(const char *standard, pcmk_resource_t *rsc, const char *rid,
87
88G_GNUC_INTERNAL
89gint pe__cmp_rsc_priority(gconstpointer a, gconstpointer b);
90
91G_GNUC_INTERNAL
92gboolean pe__unpack_resource(xmlNode *xml_obj, pcmk_resource_t **rsc,
95
96G_GNUC_INTERNAL
97gboolean unpack_remote_nodes(xmlNode *xml_resources,
99
100G_GNUC_INTERNAL
101gboolean unpack_resources(const xmlNode *xml_resources,
103
104G_GNUC_INTERNAL
105void pcmk__unpack_fencing_topology(const xmlNode *xml_fencing_topology,
107
108G_GNUC_INTERNAL
109gboolean unpack_config(xmlNode *config, pcmk_scheduler_t *scheduler);
110
111G_GNUC_INTERNAL
112gboolean unpack_nodes(xmlNode *xml_nodes, pcmk_scheduler_t *scheduler);
113
114G_GNUC_INTERNAL
115gboolean unpack_tags(xmlNode *xml_tags, pcmk_scheduler_t *scheduler);
116
117G_GNUC_INTERNAL
118gboolean unpack_status(xmlNode *status, pcmk_scheduler_t *scheduler);
119
120G_GNUC_INTERNAL
122 const char *agent,
123 pcmk_node_t *node,
125
126G_GNUC_INTERNAL
128
129// Primitive resource methods
130
131G_GNUC_INTERNAL
132unsigned int pe__primitive_max_per_node(const pcmk_resource_t *rsc);
133
134// Group resource methods
135
136G_GNUC_INTERNAL
137unsigned int pe__group_max_per_node(const pcmk_resource_t *rsc);
138
139// Clone resource methods
140
141G_GNUC_INTERNAL
142unsigned int pe__clone_max_per_node(const pcmk_resource_t *rsc);
143
144// Bundle resource methods
145
146G_GNUC_INTERNAL
148 unsigned int *count_all,
149 unsigned int *count_clean);
150
151G_GNUC_INTERNAL
152unsigned int pe__bundle_max_per_node(const pcmk_resource_t *rsc);
153
154#endif // PE_STATUS_PRIVATE__H
const char * parent
Definition cib.c:27
pcmk_scheduler_t * scheduler
const char * action
Definition pcmk_fence.c:30
G_GNUC_INTERNAL void pe__free_action_notification_data(notify_data_t *n_data)
Definition pe_notif.c:956
G_GNUC_INTERNAL unsigned int pe__bundle_max_per_node(const pcmk_resource_t *rsc)
Definition bundle.c:2267
G_GNUC_INTERNAL gboolean unpack_resources(const xmlNode *xml_resources, pcmk_scheduler_t *scheduler)
Definition unpack.c:847
G_GNUC_INTERNAL pcmk_resource_t * pe__create_clone_child(pcmk_resource_t *rsc, pcmk_scheduler_t *scheduler)
Definition clone.c:247
G_GNUC_INTERNAL gint pe__cmp_rsc_priority(gconstpointer a, gconstpointer b)
Definition utils.c:295
G_GNUC_INTERNAL void pe__force_anon(const char *standard, pcmk_resource_t *rsc, const char *rid, pcmk_scheduler_t *scheduler)
Definition clone.c:212
G_GNUC_INTERNAL gboolean unpack_tags(xmlNode *xml_tags, pcmk_scheduler_t *scheduler)
Definition unpack.c:949
struct notify_data_s notify_data_t
G_GNUC_INTERNAL gboolean pe__unpack_resource(xmlNode *xml_obj, pcmk_resource_t **rsc, pcmk_resource_t *parent, pcmk_scheduler_t *scheduler)
Definition complex.c:639
G_GNUC_INTERNAL void pe__create_action_notifications(pcmk_resource_t *rsc, notify_data_t *n_data)
Definition pe_notif.c:939
G_GNUC_INTERNAL void pcmk__unpack_fencing_topology(const xmlNode *xml_fencing_topology, pcmk_scheduler_t *scheduler)
Definition unpack.c:922
G_GNUC_INTERNAL void pe__unpack_node_health_scores(pcmk_scheduler_t *scheduler)
Definition pe_health.c:24
G_GNUC_INTERNAL unsigned int pe__group_max_per_node(const pcmk_resource_t *rsc)
Definition group.c:537
G_GNUC_INTERNAL gboolean unpack_remote_nodes(xmlNode *xml_resources, pcmk_scheduler_t *scheduler)
Definition unpack.c:703
G_GNUC_INTERNAL pcmk__op_digest_t * pe__compare_fencing_digest(pcmk_resource_t *rsc, const char *agent, pcmk_node_t *node, pcmk_scheduler_t *scheduler)
Definition pe_digest.c:551
G_GNUC_INTERNAL gboolean unpack_status(xmlNode *status, pcmk_scheduler_t *scheduler)
Definition unpack.c:1407
G_GNUC_INTERNAL notify_data_t * pe__action_notif_pseudo_ops(pcmk_resource_t *rsc, const char *task, pcmk_action_t *action, pcmk_action_t *complete)
Definition pe_notif.c:432
G_GNUC_INTERNAL pcmk_node_t * pe__bundle_active_node(const pcmk_resource_t *rsc, unsigned int *count_all, unsigned int *count_clean)
Definition bundle.c:2184
G_GNUC_INTERNAL gboolean unpack_nodes(xmlNode *xml_nodes, pcmk_scheduler_t *scheduler)
Definition unpack.c:623
G_GNUC_INTERNAL unsigned int pe__clone_max_per_node(const pcmk_resource_t *rsc)
Definition clone.c:1554
G_GNUC_INTERNAL unsigned int pe__primitive_max_per_node(const pcmk_resource_t *rsc)
Definition native.c:1467
G_GNUC_INTERNAL gboolean unpack_config(xmlNode *config, pcmk_scheduler_t *scheduler)
Definition unpack.c:214
Cluster status and scheduling.
pcmk_action_t * pre
const char * action
GHashTable * allowed_nodes
pcmk_action_t * post
pcmk_action_t * pre_done
pcmk_action_t * post_done