pacemaker 2.1.7-2.1.7
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
cib_types.h
Go to the documentation of this file.
1/*
2 * Copyright 2004-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 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
45
52
55 cib_verbose = (1 << 0),
56 cib_xpath = (1 << 1),
57 cib_multiple = (1 << 2),
58 cib_can_create = (1 << 3),
60 cib_no_children = (1 << 5),
62
64 cib_mixed_update = (1 << 7),
65
66 /* @COMPAT: cib_scope_local is processed only in the legacy function
67 * parse_local_options_v1().
68 *
69 * If (host == NULL):
70 * * In legacy mode, the CIB manager forwards a request to the primary
71 * instance unless cib_scope_local is set or the local node is primary.
72 * * Outside of legacy mode:
73 * * If a request modifies the CIB, the CIB manager forwards it to all
74 * nodes.
75 * * Otherwise, the CIB manager processes the request locally.
76 *
77 * There is no current use case for this implementing this flag in
78 * non-legacy mode.
79 */
80
82 cib_scope_local = (1 << 8),
83
84 cib_dryrun = (1 << 9),
85
100 cib_transaction = (1 << 10),
101
102 cib_sync_call = (1 << 12),
103 cib_no_mtime = (1 << 13),
104
105#if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
107 cib_zero_copy = (1 << 14),
108#endif // !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
109
111
112#if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
115#endif // !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
116
118 cib_inhibit_bcast = (1 << 24),
119
120 cib_force_diff = (1 << 28),
121};
122
123typedef struct cib_s cib_t;
124
125typedef struct cib_api_operations_s {
126 int (*signon) (cib_t *cib, const char *name, enum cib_conn_type type);
127
129 int (*signon_raw) (cib_t *cib, const char *name, enum cib_conn_type type,
130 int *event_fd);
131
132 int (*signoff) (cib_t *cib);
133 int (*free) (cib_t *cib);
134
136 int (*set_op_callback) (cib_t *cib, void (*callback) (const xmlNode *msg,
137 int callid, int rc,
138 xmlNode *output));
139
140 int (*add_notify_callback) (cib_t *cib, const char *event,
141 void (*callback) (const char *event,
142 xmlNode *msg));
143 int (*del_notify_callback) (cib_t *cib, const char *event,
144 void (*callback) (const char *event,
145 xmlNode *msg));
147 void (*dnotify) (gpointer user_data));
148
150 int (*inputfd) (cib_t *cib);
151
153 int (*noop) (cib_t *cib, int call_options);
154
155 int (*ping) (cib_t *cib, xmlNode **output_data, int call_options);
156 int (*query) (cib_t *cib, const char *section, xmlNode **output_data,
157 int call_options);
158 int (*query_from) (cib_t *cib, const char *host, const char *section,
159 xmlNode **output_data, int call_options);
160
162 int (*is_master) (cib_t *cib);
163
165 int (*set_master) (cib_t *cib, int call_options);
166
168 int (*set_slave) (cib_t *cib, int call_options);
169
171 int (*set_slave_all) (cib_t *cib, int call_options);
172
173 int (*sync) (cib_t *cib, const char *section, int call_options);
174 int (*sync_from) (cib_t *cib, const char *host, const char *section,
175 int call_options);
176 int (*upgrade) (cib_t *cib, int call_options);
177 int (*bump_epoch) (cib_t *cib, int call_options);
178 int (*create) (cib_t *cib, const char *section, xmlNode *data,
179 int call_options);
180 int (*modify) (cib_t *cib, const char *section, xmlNode *data,
181 int call_options);
182
184 int (*update) (cib_t *cib, const char *section, xmlNode *data,
185 int call_options);
186
187 int (*replace) (cib_t *cib, const char *section, xmlNode *data,
188 int call_options);
189 int (*remove) (cib_t *cib, const char *section, xmlNode *data,
190 int call_options);
191 int (*erase) (cib_t *cib, xmlNode **output_data, int call_options);
192
194 int (*delete_absolute) (cib_t *cib, const char *section, xmlNode *data,
195 int call_options);
196
198 int (*quit) (cib_t *cib, int call_options);
199
200 int (*register_notification) (cib_t *cib, const char *callback,
201 int enabled);
202 gboolean (*register_callback) (cib_t *cib, int call_id, int timeout,
203 gboolean only_success, void *user_data,
204 const char *callback_name,
205 void (*callback) (xmlNode*, int, int,
206 xmlNode*, void *));
207 gboolean (*register_callback_full)(cib_t *cib, int call_id, int timeout,
208 gboolean only_success, void *user_data,
209 const char *callback_name,
210 void (*callback)(xmlNode *, int, int,
211 xmlNode *, void *),
212 void (*free_func)(void *));
213
222 int (*set_primary)(cib_t *cib, int call_options);
223
232 int (*set_secondary)(cib_t *cib, int call_options);
233
251 int (*client_id)(const cib_t *cib, const char **async_id,
252 const char **sync_id);
253
289
314 int (*end_transaction)(cib_t *cib, bool commit, int call_options);
315
326 void (*set_user)(cib_t *cib, const char *user);
328
329struct cib_s {
333
338
340
342 void (*op_callback) (const xmlNode *msg, int call_id, int rc,
343 xmlNode *output);
344
346
347 xmlNode *transaction;
348
349 char *user;
350};
351
352#ifdef __cplusplus
353}
354#endif
355
356#endif // PCMK__CRM_CIB_CIB_TYPES__H
const char * name
Definition cib.c:26
cib_conn_type
Definition cib_types.h:46
@ cib_query
Definition cib_types.h:48
@ cib_no_connection
Definition cib_types.h:49
@ cib_command
Definition cib_types.h:47
@ cib_command_nonblocking
Definition cib_types.h:50
cib_call_options
Definition cib_types.h:53
@ cib_no_children
Definition cib_types.h:60
@ cib_scope_local
Definition cib_types.h:82
@ cib_none
Definition cib_types.h:54
@ cib_inhibit_notify
Definition cib_types.h:110
@ cib_force_diff
Definition cib_types.h:120
@ cib_xpath
Definition cib_types.h:56
@ cib_transaction
Process request when the client commits the active transaction.
Definition cib_types.h:100
@ cib_sync_call
Definition cib_types.h:102
@ cib_dryrun
Definition cib_types.h:84
@ cib_mixed_update
Definition cib_types.h:64
@ cib_verbose
Prefer stderr to logs.
Definition cib_types.h:55
@ cib_discard_reply
Definition cib_types.h:59
@ cib_no_mtime
Definition cib_types.h:103
@ cib_zero_copy
Definition cib_types.h:107
@ cib_can_create
Definition cib_types.h:58
@ cib_multiple
Definition cib_types.h:57
@ cib_inhibit_bcast
Definition cib_types.h:118
@ cib_xpath_address
Definition cib_types.h:61
@ cib_quorum_override
Definition cib_types.h:114
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:41
@ cib_connected_query
Definition cib_types.h:42
@ cib_disconnected
Definition cib_types.h:43
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
#define PCMK_ALLOW_DEPRECATED
Allow use of deprecated Pacemaker APIs.
Definition crm.h:44
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:198
int(* upgrade)(cib_t *cib, int call_options)
Definition cib_types.h:176
int(* create)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition cib_types.h:178
int(* set_master)(cib_t *cib, int call_options)
Definition cib_types.h:165
int(* noop)(cib_t *cib, int call_options)
Definition cib_types.h:153
int(* delete_absolute)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition cib_types.h:194
int(* erase)(cib_t *cib, xmlNode **output_data, int call_options)
Definition cib_types.h:191
int(* del_notify_callback)(cib_t *cib, const char *event, void(*callback)(const char *event, xmlNode *msg))
Definition cib_types.h:143
int(* add_notify_callback)(cib_t *cib, const char *event, void(*callback)(const char *event, xmlNode *msg))
Definition cib_types.h:140
int(* bump_epoch)(cib_t *cib, int call_options)
Definition cib_types.h:177
int(* set_connection_dnotify)(cib_t *cib, void(*dnotify)(gpointer user_data))
Definition cib_types.h:146
int(* is_master)(cib_t *cib)
Definition cib_types.h:162
int(* set_slave_all)(cib_t *cib, int call_options)
Definition cib_types.h:171
int(* inputfd)(cib_t *cib)
Definition cib_types.h:150
int(* remove)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition cib_types.h:189
int(* set_primary)(cib_t *cib, int call_options)
Set the local CIB manager as the cluster's primary instance.
Definition cib_types.h:222
int(* set_slave)(cib_t *cib, int call_options)
Definition cib_types.h:168
int(* query_from)(cib_t *cib, const char *host, const char *section, xmlNode **output_data, int call_options)
Definition cib_types.h:158
int(* update)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition cib_types.h:184
int(* signoff)(cib_t *cib)
Definition cib_types.h:132
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:326
int(* end_transaction)(cib_t *cib, bool commit, int call_options)
End and optionally commit this client's CIB transaction.
Definition cib_types.h:314
int(* signon)(cib_t *cib, const char *name, enum cib_conn_type type)
Definition cib_types.h:126
int(* query)(cib_t *cib, const char *section, xmlNode **output_data, int call_options)
Definition cib_types.h:156
int(* set_secondary)(cib_t *cib, int call_options)
Set the local CIB manager as a secondary instance.
Definition cib_types.h:232
int(* set_op_callback)(cib_t *cib, void(*callback)(const xmlNode *msg, int callid, int rc, xmlNode *output))
Definition cib_types.h:136
int(* sync_from)(cib_t *cib, const char *host, const char *section, int call_options)
Definition cib_types.h:174
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:202
int(* ping)(cib_t *cib, xmlNode **output_data, int call_options)
Definition cib_types.h:155
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:251
int(* register_notification)(cib_t *cib, const char *callback, int enabled)
Definition cib_types.h:200
int(* replace)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition cib_types.h:187
int(* init_transaction)(cib_t *cib)
Initiate an atomic CIB transaction for this client.
Definition cib_types.h:288
int(* sync)(cib_t *cib, const char *section, int call_options)
Definition cib_types.h:173
int(* signon_raw)(cib_t *cib, const char *name, enum cib_conn_type type, int *event_fd)
Definition cib_types.h:129
int(* free)(cib_t *cib)
Definition cib_types.h:133
int(* modify)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition cib_types.h:180
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:207
enum cib_conn_type type
Definition cib_types.h:331
enum cib_state state
Definition cib_types.h:330
GList * notify_list
Definition cib_types.h:339
xmlNode * transaction
Definition cib_types.h:347
void * variant_opaque
Definition cib_types.h:336
void * delegate_fn
Definition cib_types.h:337
cib_api_operations_t * cmds
Definition cib_types.h:345
int call_timeout
Definition cib_types.h:335
enum cib_variant variant
Definition cib_types.h:332
char * user
Definition cib_types.h:349
int call_id
Definition cib_types.h:334
void(* op_callback)(const xmlNode *msg, int call_id, int rc, xmlNode *output)
Definition cib_types.h:342
Wrappers for and extensions to libxml2.