pacemaker 2.1.8-2.1.8
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
cib_types.h
Go to the documentation of this file.
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_CIB_CIB_TYPES__H
11# define PCMK__CRM_CIB_CIB_TYPES__H
12
13# include <glib.h> // gboolean, GList
14# include <libxml/tree.h> // xmlNode
15# include <crm/common/ipc.h>
16# include <crm/common/xml.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
33
34#if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
37#endif // !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
38};
39
41 // NOTE: sbd (as of at least 1.5.2) uses this value
43
44 // NOTE: sbd (as of at least 1.5.2) uses this value
46
48};
49
52
53 // NOTE: sbd (as of at least 1.5.2) uses this value
55
58};
59
62 cib_verbose = (1 << 0),
63 cib_xpath = (1 << 1),
64 cib_multiple = (1 << 2),
65 cib_can_create = (1 << 3),
67 cib_no_children = (1 << 5),
69
71 cib_mixed_update = (1 << 7),
72
73 /* @COMPAT: cib_scope_local is processed only in the legacy function
74 * parse_local_options_v1().
75 *
76 * If (host == NULL):
77 * * In legacy mode, the CIB manager forwards a request to the primary
78 * instance unless cib_scope_local is set or the local node is primary.
79 * * Outside of legacy mode:
80 * * If a request modifies the CIB, the CIB manager forwards it to all
81 * nodes.
82 * * Otherwise, the CIB manager processes the request locally.
83 *
84 * There is no current use case for this implementing this flag in
85 * non-legacy mode.
86 */
87
88 // NOTE: sbd (as of at least 1.5.2) uses this value
90 cib_scope_local = (1 << 8),
91
92 cib_dryrun = (1 << 9),
93
108 cib_transaction = (1 << 10),
109
130 cib_score_update = (1 << 11),
131
132 // NOTE: sbd (as of at least 1.5.2) uses this value
133 cib_sync_call = (1 << 12),
134
135 cib_no_mtime = (1 << 13),
136
137#if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
139 cib_zero_copy = (1 << 14),
140#endif // !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
141
143
144#if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
147#endif // !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
148
150 cib_inhibit_bcast = (1 << 24),
151
152 cib_force_diff = (1 << 28),
153};
154
155typedef struct cib_s cib_t;
156
157typedef struct cib_api_operations_s {
158 // NOTE: sbd (as of at least 1.5.2) uses this
159 int (*signon) (cib_t *cib, const char *name, enum cib_conn_type type);
160
162 int (*signon_raw) (cib_t *cib, const char *name, enum cib_conn_type type,
163 int *event_fd);
164
165 // NOTE: sbd (as of at least 1.5.2) uses this
166 int (*signoff) (cib_t *cib);
167
168 int (*free) (cib_t *cib);
169
171 int (*set_op_callback) (cib_t *cib, void (*callback) (const xmlNode *msg,
172 int callid, int rc,
173 xmlNode *output));
174
175 // NOTE: sbd (as of at least 1.5.2) uses this
176 int (*add_notify_callback) (cib_t *cib, const char *event,
177 void (*callback) (const char *event,
178 xmlNode *msg));
179
180 // NOTE: sbd (as of at least 1.5.2) uses this
181 int (*del_notify_callback) (cib_t *cib, const char *event,
182 void (*callback) (const char *event,
183 xmlNode *msg));
184 // NOTE: sbd (as of at least 1.5.2) uses this
186 void (*dnotify) (gpointer user_data));
187
189 int (*inputfd) (cib_t *cib);
190
191 // NOTE: sbd (as of at least 1.5.2) uses this
193 int (*noop) (cib_t *cib, int call_options);
194
195 int (*ping) (cib_t *cib, xmlNode **output_data, int call_options);
196
197 // NOTE: sbd (as of at least 1.5.2) uses this
198 int (*query) (cib_t *cib, const char *section, xmlNode **output_data,
199 int call_options);
200
201 int (*query_from) (cib_t *cib, const char *host, const char *section,
202 xmlNode **output_data, int call_options);
203
205 int (*is_master) (cib_t *cib);
206
208 int (*set_master) (cib_t *cib, int call_options);
209
211 int (*set_slave) (cib_t *cib, int call_options);
212
214 int (*set_slave_all) (cib_t *cib, int call_options);
215
216 int (*sync) (cib_t *cib, const char *section, int call_options);
217 int (*sync_from) (cib_t *cib, const char *host, const char *section,
218 int call_options);
219 int (*upgrade) (cib_t *cib, int call_options);
220 int (*bump_epoch) (cib_t *cib, int call_options);
221
226 int (*create) (cib_t *cib, const char *section, xmlNode *data,
227 int call_options);
228 int (*modify) (cib_t *cib, const char *section, xmlNode *data,
229 int call_options);
230
232 int (*update) (cib_t *cib, const char *section, xmlNode *data,
233 int call_options);
234
235 int (*replace) (cib_t *cib, const char *section, xmlNode *data,
236 int call_options);
237 int (*remove) (cib_t *cib, const char *section, xmlNode *data,
238 int call_options);
239 int (*erase) (cib_t *cib, xmlNode **output_data, int call_options);
240
242 int (*delete_absolute) (cib_t *cib, const char *section, xmlNode *data,
243 int call_options);
244
246 int (*quit) (cib_t *cib, int call_options);
247
248 int (*register_notification) (cib_t *cib, const char *callback,
249 int enabled);
250 gboolean (*register_callback) (cib_t *cib, int call_id, int timeout,
251 gboolean only_success, void *user_data,
252 const char *callback_name,
253 void (*callback) (xmlNode*, int, int,
254 xmlNode*, void *));
255 gboolean (*register_callback_full)(cib_t *cib, int call_id, int timeout,
256 gboolean only_success, void *user_data,
257 const char *callback_name,
258 void (*callback)(xmlNode *, int, int,
259 xmlNode *, void *),
260 void (*free_func)(void *));
261
270 int (*set_primary)(cib_t *cib, int call_options);
271
280 int (*set_secondary)(cib_t *cib, int call_options);
281
299 int (*client_id)(const cib_t *cib, const char **async_id,
300 const char **sync_id);
301
337
362 int (*end_transaction)(cib_t *cib, bool commit, int call_options);
363
374 void (*set_user)(cib_t *cib, const char *user);
375
376 int (*fetch_schemas)(cib_t *cib, xmlNode **output_data, const char *after_ver,
377 int call_options);
379
380struct cib_s {
381 // NOTE: sbd (as of at least 1.5.2) uses this
383
386
391
393
395 void (*op_callback) (const xmlNode *msg, int call_id, int rc,
396 xmlNode *output);
397
398 // NOTE: sbd (as of at least 1.5.2) uses this
400
401 xmlNode *transaction;
402
403 char *user;
404};
405
406#ifdef __cplusplus
407}
408#endif
409
410#endif // PCMK__CRM_CIB_CIB_TYPES__H
const char * name
Definition cib.c:26
cib_conn_type
Definition cib_types.h:50
@ cib_query
Definition cib_types.h:54
@ cib_no_connection
Definition cib_types.h:56
@ cib_command
Definition cib_types.h:51
@ cib_command_nonblocking
Definition cib_types.h:57
cib_call_options
Definition cib_types.h:60
@ cib_no_children
Definition cib_types.h:67
@ cib_scope_local
Definition cib_types.h:90
@ cib_none
Definition cib_types.h:61
@ cib_inhibit_notify
Definition cib_types.h:142
@ cib_score_update
Treat new attribute values as atomic score updates where possible.
Definition cib_types.h:130
@ cib_force_diff
Definition cib_types.h:152
@ cib_xpath
Definition cib_types.h:63
@ cib_transaction
Process request when the client commits the active transaction.
Definition cib_types.h:108
@ cib_sync_call
Definition cib_types.h:133
@ cib_dryrun
Definition cib_types.h:92
@ cib_mixed_update
Definition cib_types.h:71
@ cib_verbose
Prefer stderr to logs.
Definition cib_types.h:62
@ cib_discard_reply
Definition cib_types.h:66
@ cib_no_mtime
Definition cib_types.h:135
@ cib_zero_copy
Definition cib_types.h:139
@ cib_can_create
Definition cib_types.h:65
@ cib_multiple
Definition cib_types.h:64
@ cib_inhibit_bcast
Definition cib_types.h:150
@ cib_xpath_address
Definition cib_types.h:68
@ cib_quorum_override
Definition cib_types.h:146
struct cib_api_operations_s cib_api_operations_t
cib_variant
Definition cib_types.h:28
@ cib_native
Definition cib_types.h:30
@ cib_undefined
Definition cib_types.h:29
@ cib_remote
Definition cib_types.h:32
@ cib_database
Definition cib_types.h:36
@ cib_file
Definition cib_types.h:31
cib_state
Definition cib_types.h:40
@ cib_connected_command
Definition cib_types.h:42
@ cib_connected_query
Definition cib_types.h:45
@ cib_disconnected
Definition cib_types.h:47
pcmk__cpg_host_t host
Definition cpg.c:4
enum crm_ais_msg_types type
Definition cpg.c:3
char data[0]
Definition cpg.c:10
IPC interface to Pacemaker daemons.
unsigned int timeout
Definition pcmk_fence.c:32
int(* quit)(cib_t *cib, int call_options)
Definition cib_types.h:246
int(* fetch_schemas)(cib_t *cib, xmlNode **output_data, const char *after_ver, int call_options)
Definition cib_types.h:376
int(* upgrade)(cib_t *cib, int call_options)
Definition cib_types.h:219
int(* create)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition cib_types.h:226
int(* set_master)(cib_t *cib, int call_options)
Definition cib_types.h:208
int(* noop)(cib_t *cib, int call_options)
Definition cib_types.h:193
int(* delete_absolute)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition cib_types.h:242
int(* erase)(cib_t *cib, xmlNode **output_data, int call_options)
Definition cib_types.h:239
int(* del_notify_callback)(cib_t *cib, const char *event, void(*callback)(const char *event, xmlNode *msg))
Definition cib_types.h:181
int(* add_notify_callback)(cib_t *cib, const char *event, void(*callback)(const char *event, xmlNode *msg))
Definition cib_types.h:176
int(* bump_epoch)(cib_t *cib, int call_options)
Definition cib_types.h:220
int(* set_connection_dnotify)(cib_t *cib, void(*dnotify)(gpointer user_data))
Definition cib_types.h:185
int(* is_master)(cib_t *cib)
Definition cib_types.h:205
int(* set_slave_all)(cib_t *cib, int call_options)
Definition cib_types.h:214
int(* inputfd)(cib_t *cib)
Definition cib_types.h:189
int(* remove)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition cib_types.h:237
int(* set_primary)(cib_t *cib, int call_options)
Set the local CIB manager as the cluster's primary instance.
Definition cib_types.h:270
int(* set_slave)(cib_t *cib, int call_options)
Definition cib_types.h:211
int(* query_from)(cib_t *cib, const char *host, const char *section, xmlNode **output_data, int call_options)
Definition cib_types.h:201
int(* update)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition cib_types.h:232
int(* signoff)(cib_t *cib)
Definition cib_types.h:166
void(* set_user)(cib_t *cib, const char *user)
Set the user as whom all CIB requests via methods will be executed.
Definition cib_types.h:374
int(* end_transaction)(cib_t *cib, bool commit, int call_options)
End and optionally commit this client's CIB transaction.
Definition cib_types.h:362
int(* signon)(cib_t *cib, const char *name, enum cib_conn_type type)
Definition cib_types.h:159
int(* query)(cib_t *cib, const char *section, xmlNode **output_data, int call_options)
Definition cib_types.h:198
int(* set_secondary)(cib_t *cib, int call_options)
Set the local CIB manager as a secondary instance.
Definition cib_types.h:280
int(* set_op_callback)(cib_t *cib, void(*callback)(const xmlNode *msg, int callid, int rc, xmlNode *output))
Definition cib_types.h:171
int(* sync_from)(cib_t *cib, const char *host, const char *section, int call_options)
Definition cib_types.h:217
gboolean(* register_callback)(cib_t *cib, int call_id, int timeout, gboolean only_success, void *user_data, const char *callback_name, void(*callback)(xmlNode *, int, int, xmlNode *, void *))
Definition cib_types.h:250
int(* ping)(cib_t *cib, xmlNode **output_data, int call_options)
Definition cib_types.h:195
int(* client_id)(const cib_t *cib, const char **async_id, const char **sync_id)
Get the given CIB connection's unique client identifier(s)
Definition cib_types.h:299
int(* register_notification)(cib_t *cib, const char *callback, int enabled)
Definition cib_types.h:248
int(* replace)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition cib_types.h:235
int(* init_transaction)(cib_t *cib)
Initiate an atomic CIB transaction for this client.
Definition cib_types.h:336
int(* sync)(cib_t *cib, const char *section, int call_options)
Definition cib_types.h:216
int(* signon_raw)(cib_t *cib, const char *name, enum cib_conn_type type, int *event_fd)
Definition cib_types.h:162
int(* free)(cib_t *cib)
Definition cib_types.h:168
int(* modify)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition cib_types.h:228
gboolean(* register_callback_full)(cib_t *cib, int call_id, int timeout, gboolean only_success, void *user_data, const char *callback_name, void(*callback)(xmlNode *, int, int, xmlNode *, void *), void(*free_func)(void *))
Definition cib_types.h:255
enum cib_conn_type type
Definition cib_types.h:384
enum cib_state state
Definition cib_types.h:382
GList * notify_list
Definition cib_types.h:392
xmlNode * transaction
Definition cib_types.h:401
void * variant_opaque
Definition cib_types.h:389
void * delegate_fn
Definition cib_types.h:390
cib_api_operations_t * cmds
Definition cib_types.h:399
int call_timeout
Definition cib_types.h:388
enum cib_variant variant
Definition cib_types.h:385
char * user
Definition cib_types.h:403
int call_id
Definition cib_types.h:387
void(* op_callback)(const xmlNode *msg, int call_id, int rc, xmlNode *output)
Definition cib_types.h:395
Wrappers for and extensions to libxml2.