10#ifndef CIB_INTERNAL__H
11# define CIB_INTERNAL__H
17#define PCMK__CIB_REQUEST_SECONDARY "cib_slave"
18#define PCMK__CIB_REQUEST_PRIMARY "cib_master"
19#define PCMK__CIB_REQUEST_SYNC_TO_ALL "cib_sync"
20#define PCMK__CIB_REQUEST_SYNC_TO_ONE "cib_sync_one"
21#define PCMK__CIB_REQUEST_IS_PRIMARY "cib_ismaster"
22#define PCMK__CIB_REQUEST_BUMP "cib_bump"
23#define PCMK__CIB_REQUEST_QUERY "cib_query"
24#define PCMK__CIB_REQUEST_CREATE "cib_create"
25#define PCMK__CIB_REQUEST_MODIFY "cib_modify"
26#define PCMK__CIB_REQUEST_DELETE "cib_delete"
27#define PCMK__CIB_REQUEST_ERASE "cib_erase"
28#define PCMK__CIB_REQUEST_REPLACE "cib_replace"
29#define PCMK__CIB_REQUEST_APPLY_PATCH "cib_apply_diff"
30#define PCMK__CIB_REQUEST_UPGRADE "cib_upgrade"
31#define PCMK__CIB_REQUEST_ABS_DELETE "cib_delete_alt"
32#define PCMK__CIB_REQUEST_NOOP "noop"
33#define PCMK__CIB_REQUEST_SHUTDOWN "cib_shutdown_req"
34#define PCMK__CIB_REQUEST_COMMIT_TRANSACT "cib_commit_transact"
36# define F_CIB_CLIENTID "cib_clientid"
37# define F_CIB_CALLOPTS "cib_callopt"
38# define F_CIB_CALLID "cib_callid"
39# define F_CIB_CALLDATA "cib_calldata"
40# define F_CIB_OPERATION "cib_op"
41# define F_CIB_ISREPLY "cib_isreplyto"
42# define F_CIB_SECTION "cib_section"
43# define F_CIB_HOST "cib_host"
44# define F_CIB_RC "cib_rc"
45# define F_CIB_UPGRADE_RC "cib_upgrade_rc"
46# define F_CIB_DELEGATED "cib_delegated_from"
47# define F_CIB_OBJID "cib_object"
48# define F_CIB_OBJTYPE "cib_object_type"
49# define F_CIB_EXISTING "cib_existing_object"
50# define F_CIB_SEENCOUNT "cib_seen"
51# define F_CIB_TIMEOUT "cib_timeout"
52# define F_CIB_UPDATE "cib_update"
53# define F_CIB_GLOBAL_UPDATE "cib_update"
54# define F_CIB_UPDATE_RESULT "cib_update_result"
55# define F_CIB_CLIENTNAME "cib_clientname"
56# define F_CIB_NOTIFY_TYPE "cib_notify_type"
57# define F_CIB_NOTIFY_ACTIVATE "cib_notify_activate"
58# define F_CIB_UPDATE_DIFF "cib_update_diff"
59# define F_CIB_USER "cib_user"
60# define F_CIB_LOCAL_NOTIFY_ID "cib_local_notify_id"
61# define F_CIB_PING_ID "cib_ping_id"
62# define F_CIB_SCHEMA_MAX "cib_schema_max"
65# define T_CIB_COMMAND "cib_command"
66# define T_CIB_NOTIFY "cib_notify"
68# define T_CIB_PRE_NOTIFY "cib_pre_notify"
69# define T_CIB_POST_NOTIFY "cib_post_notify"
70# define T_CIB_TRANSACTION "cib_transaction"
71# define T_CIB_UPDATE_CONFIRM "cib_update_confirmation"
116 int *_admin_epoch,
int *_epoch,
int *_updates);
121 xmlNode *, xmlNode *, xmlNode **, xmlNode **);
138 void (*
callback) (xmlNode *, int, int, xmlNode *,
void *);
153#define cib__set_call_options(cib_call_opts, call_for, flags_to_set) do { \
154 cib_call_opts = pcmk__set_flags_as(__func__, __LINE__, \
155 LOG_TRACE, "CIB call", (call_for), (cib_call_opts), \
156 (flags_to_set), #flags_to_set); \
159#define cib__clear_call_options(cib_call_opts, call_for, flags_to_clear) do { \
160 cib_call_opts = pcmk__clear_flags_as(__func__, __LINE__, \
161 LOG_TRACE, "CIB call", (call_for), (cib_call_opts), \
162 (flags_to_clear), #flags_to_clear); \
191cib__client_triggers_refresh(
const char *
name)
208 bool is_query,
const char *section, xmlNode *req,
209 xmlNode *
input,
bool manage_counters,
bool *config_changed,
210 xmlNode **current_cib, xmlNode **result_cib, xmlNode **diff,
214 const char *section, xmlNode *
data,
int call_options,
215 const char *user_name,
const char *client_name,
225int cib_process_query(
const char *op,
int options,
const char *section, xmlNode * req,
226 xmlNode *
input, xmlNode * existing_cib, xmlNode ** result_cib,
229int cib_process_erase(
const char *op,
int options,
const char *section, xmlNode * req,
230 xmlNode *
input, xmlNode * existing_cib, xmlNode ** result_cib,
233int cib_process_bump(
const char *op,
int options,
const char *section, xmlNode * req,
234 xmlNode *
input, xmlNode * existing_cib, xmlNode ** result_cib,
238 xmlNode *
input, xmlNode * existing_cib, xmlNode ** result_cib,
241int cib_process_create(
const char *op,
int options,
const char *section, xmlNode * req,
242 xmlNode *
input, xmlNode * existing_cib, xmlNode ** result_cib,
245int cib_process_modify(
const char *op,
int options,
const char *section, xmlNode * req,
246 xmlNode *
input, xmlNode * existing_cib, xmlNode ** result_cib,
249int cib_process_delete(
const char *op,
int options,
const char *section, xmlNode * req,
250 xmlNode *
input, xmlNode * existing_cib, xmlNode ** result_cib,
253int cib_process_diff(
const char *op,
int options,
const char *section, xmlNode * req,
254 xmlNode *
input, xmlNode * existing_cib, xmlNode ** result_cib,
258 xmlNode *
input, xmlNode * existing_cib, xmlNode ** result_cib,
284 const xmlNode *req, xmlNode *
input, xmlNode *existing_cib,
285 xmlNode **result_cib, xmlNode ** answer);
290 const char *section, xmlNode *
data,
291 xmlNode ** output_data,
int call_options,
const char *user_name);
297 const char *cib_filename);
329 const char *section,
const char *node_uuid,
const char *set_type,
330 const char *set_name,
const char *attr_id,
const char *attr_name,
331 const char *attr_value,
const char *user_name,
335 const char *node_uuid,
const char *set_type,
const char *set_name,
336 const char *attr_id,
const char *attr_name,
const char *user_name,
340 const char *section,
const char *node_uuid,
const char *set_type,
341 const char *set_name,
const char *attr_id,
const char *attr_name,
342 const char *attr_value,
const char *user_name);
int cib__extend_transaction(cib_t *cib, xmlNode *request)
int cib__clean_up_connection(cib_t **cib)
void cib_native_callback(cib_t *cib, xmlNode *msg, int call_id, int rc)
int cib_process_delete(const char *op, int options, const char *section, xmlNode *req, xmlNode *input, xmlNode *existing_cib, xmlNode **result_cib, xmlNode **answer)
int cib_process_xpath(const char *op, int options, const char *section, const xmlNode *req, xmlNode *input, xmlNode *existing_cib, xmlNode **result_cib, xmlNode **answer)
int cib__get_operation(const char *op, const cib__operation_t **operation)
int cib__get_notify_patchset(const xmlNode *msg, const xmlNode **patchset)
int cib_process_query(const char *op, int options, const char *section, xmlNode *req, xmlNode *input, xmlNode *existing_cib, xmlNode **result_cib, xmlNode **answer)
struct cib_callback_client_s cib_callback_client_t
int cib_process_modify(const char *op, int options, const char *section, xmlNode *req, xmlNode *input, xmlNode *existing_cib, xmlNode **result_cib, xmlNode **answer)
cib_t * cib_new_variant(void)
@ cib__op_attr_none
No special attributes.
@ cib__op_attr_transaction
Supported in a transaction.
@ cib__op_attr_privileged
Requires privileges.
@ cib__op_attr_local
Must only be processed locally.
@ cib__op_attr_replaces
Replaces CIB.
@ cib__op_attr_modifies
Modifies CIB.
@ cib__op_attr_writes_through
Writes to disk on success.
int cib_file_write_with_digest(xmlNode *cib_root, const char *cib_dirname, const char *cib_filename)
int cib_process_create(const char *op, int options, const char *section, xmlNode *req, xmlNode *input, xmlNode *existing_cib, xmlNode **result_cib, xmlNode **answer)
bool cib__config_changed_v1(xmlNode *last, xmlNode *next, xmlNode **diff)
int cib__get_node_attrs(pcmk__output_t *out, cib_t *cib, const char *section, const char *node_uuid, const char *set_type, const char *set_name, const char *attr_id, const char *attr_name, const char *user_name, xmlNode **result)
int cib__signon_query(pcmk__output_t *out, cib_t **cib, xmlNode **cib_object)
struct cib_notify_client_s cib_notify_client_t
int cib__create_op(cib_t *cib, const char *op, const char *host, const char *section, xmlNode *data, int call_options, const char *user_name, const char *client_name, xmlNode **op_msg)
int cib_process_bump(const char *op, int options, const char *section, xmlNode *req, xmlNode *input, xmlNode *existing_cib, xmlNode **result_cib, xmlNode **answer)
int cib_process_replace(const char *op, int options, const char *section, xmlNode *req, xmlNode *input, xmlNode *existing_cib, xmlNode **result_cib, xmlNode **answer)
int cib__update_node_attr(pcmk__output_t *out, cib_t *cib, int call_options, const char *section, const char *node_uuid, const char *set_type, const char *set_name, const char *attr_id, const char *attr_name, const char *attr_value, const char *user_name, const char *node_type)
void cib__set_output(cib_t *cib, pcmk__output_t *out)
int cib_internal_op(cib_t *cib, const char *op, const char *host, const char *section, xmlNode *data, xmlNode **output_data, int call_options, const char *user_name)
gboolean cib_diff_version_details(xmlNode *diff, int *admin_epoch, int *epoch, int *updates, int *_admin_epoch, int *_epoch, int *_updates)
int cib_process_diff(const char *op, int options, const char *section, xmlNode *req, xmlNode *input, xmlNode *existing_cib, xmlNode **result_cib, xmlNode **answer)
int cib_perform_op(const char *op, int call_options, cib__op_fn_t fn, bool is_query, const char *section, xmlNode *req, xmlNode *input, bool manage_counters, bool *config_changed, xmlNode **current_cib, xmlNode **result_cib, xmlNode **diff, xmlNode **output)
int cib_process_upgrade(const char *op, int options, const char *section, xmlNode *req, xmlNode *input, xmlNode *existing_cib, xmlNode **result_cib, xmlNode **answer)
cib_callback_client_t * cib__lookup_id(int call_id)
int cib__delete_node_attr(pcmk__output_t *out, cib_t *cib, int options, const char *section, const char *node_uuid, const char *set_type, const char *set_name, const char *attr_id, const char *attr_name, const char *attr_value, const char *user_name)
int(* cib__op_fn_t)(const char *, int, const char *, xmlNode *, xmlNode *, xmlNode *, xmlNode **, xmlNode **)
struct cib__operation_s cib__operation_t
int cib_process_erase(const char *op, int options, const char *section, xmlNode *req, xmlNode *input, xmlNode *existing_cib, xmlNode **result_cib, xmlNode **answer)
@ cib__op_commit_transact
gboolean cib_read_config(GHashTable *options, xmlNode *current_cib)
bool cib__element_in_patchset(const xmlNode *patchset, const char *element)
int cib_file_read_and_verify(const char *filename, const char *sigfile, xmlNode **root)
void cib_native_notify(gpointer data, gpointer user_data)
bool crm_is_daemon_name(const char *name)
Check whether string represents a client name used by cluster daemons.
node_type
Possible node types.
Formatted output for pacemaker tools.
pcmk__action_result_t result
bool pcmk__str_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
uint32_t flags
Group of enum cib__op_attr flags.
void(* callback)(xmlNode *, int, int, xmlNode *, void *)
void(* free_func)(void *)
struct timer_rec_s * timer
void(* callback)(const char *event, xmlNode *msg)
This structure contains everything that makes up a single output formatter.