pacemaker 3.0.1-16e74fc4da
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
34
36 // NOTE: sbd (as of at least 1.5.2) uses this value
38
39 // NOTE: sbd (as of at least 1.5.2) uses this value
41
43};
44
47
48 // NOTE: sbd (as of at least 1.5.2) uses this value
50
53};
54
57 cib_verbose = (1 << 0),
58 cib_xpath = (1 << 1),
59 cib_multiple = (1 << 2),
60 cib_can_create = (1 << 3),
62 cib_no_children = (1 << 5),
64
65#if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
66 // NOTE: sbd (as of at least 1.5.2) uses this value
68 cib_scope_local = (1 << 8),
69#endif // !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
70
71 cib_dryrun = (1 << 9),
72
87 cib_transaction = (1 << 10),
88
109 cib_score_update = (1 << 11),
110
111 // NOTE: sbd (as of at least 1.5.2) uses this value
112 cib_sync_call = (1 << 12),
113
114 cib_no_mtime = (1 << 13),
116 cib_force_diff = (1 << 28),
117};
118
119typedef struct cib_s cib_t;
120
121typedef struct cib_api_operations_s {
122 // NOTE: sbd (as of at least 1.5.2) uses this
123 // @COMPAT At compatibility break, drop name (always use crm_system_name)
124 int (*signon) (cib_t *cib, const char *name, enum cib_conn_type type);
125
126 // NOTE: sbd (as of at least 1.5.2) uses this
127 int (*signoff) (cib_t *cib);
128
129 int (*free) (cib_t *cib);
130
131 // NOTE: sbd (as of at least 1.5.2) uses this
132 int (*add_notify_callback) (cib_t *cib, const char *event,
133 void (*callback) (const char *event,
134 xmlNode *msg));
135
136 // NOTE: sbd (as of at least 1.5.2) uses this
137 int (*del_notify_callback) (cib_t *cib, const char *event,
138 void (*callback) (const char *event,
139 xmlNode *msg));
140 // NOTE: sbd (as of at least 1.5.2) uses this
142 void (*dnotify) (gpointer user_data));
143
144 // NOTE: sbd (as of at least 1.5.2) uses this
146 int (*noop) (cib_t *cib, int call_options);
147
148 int (*ping) (cib_t *cib, xmlNode **output_data, int call_options);
149
150 // NOTE: sbd (as of at least 1.5.2) uses this
151 int (*query) (cib_t *cib, const char *section, xmlNode **output_data,
152 int call_options);
153
154 int (*query_from) (cib_t *cib, const char *host, const char *section,
155 xmlNode **output_data, int call_options);
156
157 int (*sync) (cib_t *cib, const char *section, int call_options);
158 int (*sync_from) (cib_t *cib, const char *host, const char *section,
159 int call_options);
160 int (*upgrade) (cib_t *cib, int call_options);
161 int (*bump_epoch) (cib_t *cib, int call_options);
162
167 int (*create) (cib_t *cib, const char *section, xmlNode *data,
168 int call_options);
169 int (*modify) (cib_t *cib, const char *section, xmlNode *data,
170 int call_options);
171
172 int (*replace) (cib_t *cib, const char *section, xmlNode *data,
173 int call_options);
174 int (*remove) (cib_t *cib, const char *section, xmlNode *data,
175 int call_options);
176 int (*erase) (cib_t *cib, xmlNode **output_data, int call_options);
177
178 int (*register_notification) (cib_t *cib, const char *callback,
179 int enabled);
180 gboolean (*register_callback) (cib_t *cib, int call_id, int timeout,
181 gboolean only_success, void *user_data,
182 const char *callback_name,
183 void (*callback) (xmlNode*, int, int,
184 xmlNode*, void *));
185 gboolean (*register_callback_full)(cib_t *cib, int call_id, int timeout,
186 gboolean only_success, void *user_data,
187 const char *callback_name,
188 void (*callback)(xmlNode *, int, int,
189 xmlNode *, void *),
190 void (*free_func)(void *));
191
200 int (*set_primary)(cib_t *cib, int call_options);
201
210 int (*set_secondary)(cib_t *cib, int call_options);
211
229 int (*client_id)(const cib_t *cib, const char **async_id,
230 const char **sync_id);
231
267
292 int (*end_transaction)(cib_t *cib, bool commit, int call_options);
293
304 void (*set_user)(cib_t *cib, const char *user);
305
306 int (*fetch_schemas)(cib_t *cib, xmlNode **output_data, const char *after_ver,
307 int call_options);
309
310struct cib_s {
311 // NOTE: sbd (as of at least 1.5.2) uses this
313
316
321
323
324 // NOTE: sbd (as of at least 1.5.2) uses this
326
327 xmlNode *transaction;
328
329 char *user;
330};
331
332#ifdef __cplusplus
333}
334#endif
335
336#endif // PCMK__CRM_CIB_CIB_TYPES__H
const char * name
Definition cib.c:26
cib_conn_type
Definition cib_types.h:45
@ cib_query
Definition cib_types.h:49
@ cib_no_connection
Definition cib_types.h:51
@ cib_command
Definition cib_types.h:46
@ cib_command_nonblocking
Definition cib_types.h:52
cib_call_options
Definition cib_types.h:55
@ cib_no_children
Definition cib_types.h:62
@ cib_scope_local
Definition cib_types.h:68
@ cib_none
Definition cib_types.h:56
@ cib_inhibit_notify
Definition cib_types.h:115
@ cib_score_update
Treat new attribute values as atomic score updates where possible.
Definition cib_types.h:109
@ cib_force_diff
Definition cib_types.h:116
@ cib_xpath
Definition cib_types.h:58
@ cib_transaction
Process request when the client commits the active transaction.
Definition cib_types.h:87
@ cib_sync_call
Definition cib_types.h:112
@ cib_dryrun
Definition cib_types.h:71
@ cib_verbose
Prefer stderr to logs.
Definition cib_types.h:57
@ cib_discard_reply
Definition cib_types.h:61
@ cib_no_mtime
Definition cib_types.h:114
@ cib_can_create
Definition cib_types.h:60
@ cib_multiple
Definition cib_types.h:59
@ cib_xpath_address
Definition cib_types.h:63
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_file
Definition cib_types.h:31
cib_state
Definition cib_types.h:35
@ cib_connected_command
Definition cib_types.h:37
@ cib_connected_query
Definition cib_types.h:40
@ cib_disconnected
Definition cib_types.h:42
pcmk__cpg_host_t host
Definition cpg.c:4
char data[0]
Definition cpg.c:10
enum pcmk_ipc_server type
Definition cpg.c:3
#define PCMK_ALLOW_DEPRECATED
Allow use of deprecated Pacemaker APIs.
Definition crm.h:46
IPC interface to Pacemaker daemons.
unsigned int timeout
Definition pcmk_fence.c:34
int(* fetch_schemas)(cib_t *cib, xmlNode **output_data, const char *after_ver, int call_options)
Definition cib_types.h:306
int(* upgrade)(cib_t *cib, int call_options)
Definition cib_types.h:160
int(* create)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition cib_types.h:167
int(* noop)(cib_t *cib, int call_options)
Definition cib_types.h:146
int(* erase)(cib_t *cib, xmlNode **output_data, int call_options)
Definition cib_types.h:176
int(* del_notify_callback)(cib_t *cib, const char *event, void(*callback)(const char *event, xmlNode *msg))
Definition cib_types.h:137
int(* add_notify_callback)(cib_t *cib, const char *event, void(*callback)(const char *event, xmlNode *msg))
Definition cib_types.h:132
int(* bump_epoch)(cib_t *cib, int call_options)
Definition cib_types.h:161
int(* set_connection_dnotify)(cib_t *cib, void(*dnotify)(gpointer user_data))
Definition cib_types.h:141
int(* remove)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition cib_types.h:174
int(* set_primary)(cib_t *cib, int call_options)
Set the local CIB manager as the cluster's primary instance.
Definition cib_types.h:200
int(* query_from)(cib_t *cib, const char *host, const char *section, xmlNode **output_data, int call_options)
Definition cib_types.h:154
int(* signoff)(cib_t *cib)
Definition cib_types.h:127
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:304
int(* end_transaction)(cib_t *cib, bool commit, int call_options)
End and optionally commit this client's CIB transaction.
Definition cib_types.h:292
int(* signon)(cib_t *cib, const char *name, enum cib_conn_type type)
Definition cib_types.h:124
int(* query)(cib_t *cib, const char *section, xmlNode **output_data, int call_options)
Definition cib_types.h:151
int(* set_secondary)(cib_t *cib, int call_options)
Set the local CIB manager as a secondary instance.
Definition cib_types.h:210
int(* sync_from)(cib_t *cib, const char *host, const char *section, int call_options)
Definition cib_types.h:158
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:180
int(* ping)(cib_t *cib, xmlNode **output_data, int call_options)
Definition cib_types.h:148
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:229
int(* register_notification)(cib_t *cib, const char *callback, int enabled)
Definition cib_types.h:178
int(* replace)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition cib_types.h:172
int(* init_transaction)(cib_t *cib)
Initiate an atomic CIB transaction for this client.
Definition cib_types.h:266
int(* sync)(cib_t *cib, const char *section, int call_options)
Definition cib_types.h:157
int(* free)(cib_t *cib)
Definition cib_types.h:129
int(* modify)(cib_t *cib, const char *section, xmlNode *data, int call_options)
Definition cib_types.h:169
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:185
enum cib_conn_type type
Definition cib_types.h:314
enum cib_state state
Definition cib_types.h:312
GList * notify_list
Definition cib_types.h:322
xmlNode * transaction
Definition cib_types.h:327
void * variant_opaque
Definition cib_types.h:319
void * delegate_fn
Definition cib_types.h:320
cib_api_operations_t * cmds
Definition cib_types.h:325
int call_timeout
Definition cib_types.h:318
enum cib_variant variant
Definition cib_types.h:315
char * user
Definition cib_types.h:329
int call_id
Definition cib_types.h:317
Wrappers for and extensions to libxml2.