pacemaker  2.1.8-3980678f03
Scalable High-Availability cluster resource manager
Data Fields
cib_api_operations_s Struct Reference

#include <include/crm/cib/cib_types.h>

Data Fields

int(* signon )(cib_t *cib, const char *name, enum cib_conn_type type)
 
int(* signon_raw )(cib_t *cib, const char *name, enum cib_conn_type type, int *event_fd)
 
int(* signoff )(cib_t *cib)
 
int(* free )(cib_t *cib)
 
int(* set_op_callback )(cib_t *cib, void(*callback)(const xmlNode *msg, int callid, int rc, xmlNode *output))
 
int(* add_notify_callback )(cib_t *cib, const char *event, void(*callback)(const char *event, xmlNode *msg))
 
int(* del_notify_callback )(cib_t *cib, const char *event, void(*callback)(const char *event, xmlNode *msg))
 
int(* set_connection_dnotify )(cib_t *cib, void(*dnotify)(gpointer user_data))
 
int(* inputfd )(cib_t *cib)
 
int(* noop )(cib_t *cib, int call_options)
 
int(* ping )(cib_t *cib, xmlNode **output_data, int call_options)
 
int(* query )(cib_t *cib, const char *section, xmlNode **output_data, int call_options)
 
int(* query_from )(cib_t *cib, const char *host, const char *section, xmlNode **output_data, int call_options)
 
int(* is_master )(cib_t *cib)
 
int(* set_master )(cib_t *cib, int call_options)
 
int(* set_slave )(cib_t *cib, int call_options)
 
int(* set_slave_all )(cib_t *cib, int call_options)
 
int(* sync )(cib_t *cib, const char *section, int call_options)
 
int(* sync_from )(cib_t *cib, const char *host, const char *section, int call_options)
 
int(* upgrade )(cib_t *cib, int call_options)
 
int(* bump_epoch )(cib_t *cib, int call_options)
 
int(* create )(cib_t *cib, const char *section, xmlNode *data, int call_options)
 
int(* modify )(cib_t *cib, const char *section, xmlNode *data, int call_options)
 
int(* update )(cib_t *cib, const char *section, xmlNode *data, int call_options)
 
int(* replace )(cib_t *cib, const char *section, xmlNode *data, int call_options)
 
int(* remove )(cib_t *cib, const char *section, xmlNode *data, int call_options)
 
int(* erase )(cib_t *cib, xmlNode **output_data, int call_options)
 
int(* delete_absolute )(cib_t *cib, const char *section, xmlNode *data, int call_options)
 
int(* quit )(cib_t *cib, int call_options)
 
int(* register_notification )(cib_t *cib, const char *callback, int enabled)
 
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 *))
 
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 *))
 
int(* set_primary )(cib_t *cib, int call_options)
 Set the local CIB manager as the cluster's primary instance. More...
 
int(* set_secondary )(cib_t *cib, int call_options)
 Set the local CIB manager as a secondary instance. More...
 
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) More...
 
int(* init_transaction )(cib_t *cib)
 Initiate an atomic CIB transaction for this client. More...
 
int(* end_transaction )(cib_t *cib, bool commit, int call_options)
 End and optionally commit this client's CIB transaction. More...
 
void(* set_user )(cib_t *cib, const char *user)
 Set the user as whom all CIB requests via methods will be executed. More...
 
int(* fetch_schemas )(cib_t *cib, xmlNode **output_data, const char *after_ver, int call_options)
 

Detailed Description

Definition at line 157 of file cib_types.h.

Field Documentation

◆ add_notify_callback

int(* cib_api_operations_s::add_notify_callback) (cib_t *cib, const char *event, void(*callback)(const char *event, xmlNode *msg))

Definition at line 176 of file cib_types.h.

◆ bump_epoch

int(* cib_api_operations_s::bump_epoch) (cib_t *cib, int call_options)

Definition at line 220 of file cib_types.h.

◆ client_id

int(* cib_api_operations_s::client_id) (const cib_t *cib, const char **async_id, const char **sync_id)

Get the given CIB connection's unique client identifier(s)

These can be used to check whether this client requested the action that triggered a CIB notification.

Parameters
[in]cibCIB connection
[out]async_idIf not NULL, where to store asynchronous client ID
[out]sync_idIf not NULL, where to store synchronous client ID
Returns
Legacy Pacemaker return code
Note
Some variants may have only one client for both asynchronous and synchronous requests.

Definition at line 299 of file cib_types.h.

◆ create

int(* cib_api_operations_s::create) (cib_t *cib, const char *section, xmlNode *data, int call_options)

The <failed> element in the reply to a failed creation call is deprecated since 2.1.8.

Definition at line 226 of file cib_types.h.

◆ del_notify_callback

int(* cib_api_operations_s::del_notify_callback) (cib_t *cib, const char *event, void(*callback)(const char *event, xmlNode *msg))

Definition at line 181 of file cib_types.h.

◆ delete_absolute

int(* cib_api_operations_s::delete_absolute) (cib_t *cib, const char *section, xmlNode *data, int call_options)
Deprecated:
This method does nothing and should not be called

Definition at line 242 of file cib_types.h.

◆ end_transaction

int(* cib_api_operations_s::end_transaction) (cib_t *cib, bool commit, int call_options)

End and optionally commit this client's CIB transaction.

When a client commits a transaction, all requests in the transaction are processed in a FIFO manner until either a request fails or all requests have been processed. Changes are applied to a working copy of the CIB. If a request fails, the transaction and working CIB copy are discarded, and an error is returned. If all requests succeed, the working CIB copy replaces the initial CIB copy.

Callbacks and notifications can be triggered by the commit request itself but not by the individual requests in a transaction.

An end_transaction() call with commit set to false is always synchronous.

Parameters
[in,out]cibCIB connection
[in]commitIf true, commit transaction; otherwise, discard it
[in]call_optionsGroup of enum cib_call_options flags
Returns
Legacy Pacemaker return code

Definition at line 362 of file cib_types.h.

◆ erase

int(* cib_api_operations_s::erase) (cib_t *cib, xmlNode **output_data, int call_options)

Definition at line 239 of file cib_types.h.

◆ fetch_schemas

int(* cib_api_operations_s::fetch_schemas) (cib_t *cib, xmlNode **output_data, const char *after_ver, int call_options)

Definition at line 376 of file cib_types.h.

◆ free

int(* cib_api_operations_s::free) (cib_t *cib)

Definition at line 168 of file cib_types.h.

◆ init_transaction

int(* cib_api_operations_s::init_transaction) (cib_t *cib)

Initiate an atomic CIB transaction for this client.

If the client has initiated a transaction and a new request's call options contain cib_transaction, the new request is appended to the transaction for later processing.

Supported requests are those that meet the following conditions:

  • can be processed synchronously (with any changes applied to a working CIB copy)
  • are not queries
  • do not involve other nodes
  • do not affect the state of pacemaker-based itself

Currently supported CIB API functions include:

Because the transaction is atomic, individual requests do not trigger callbacks or notifications when they are processed, and they do not receive output XML. The commit request itself can trigger callbacks and notifications if any are registered.

An init_transaction() call is always synchronous.

Parameters
[in,out]cibCIB connection
Returns
Legacy Pacemaker return code

Definition at line 336 of file cib_types.h.

◆ inputfd

int(* cib_api_operations_s::inputfd) (cib_t *cib)
Deprecated:
This method will be removed and should not be used

Definition at line 189 of file cib_types.h.

◆ is_master

int(* cib_api_operations_s::is_master) (cib_t *cib)
Deprecated:
This method will be removed and should not be used

Definition at line 205 of file cib_types.h.

◆ modify

int(* cib_api_operations_s::modify) (cib_t *cib, const char *section, xmlNode *data, int call_options)

Definition at line 228 of file cib_types.h.

◆ noop

int(* cib_api_operations_s::noop) (cib_t *cib, int call_options)
Deprecated:
This method will be removed and should not be used

Definition at line 193 of file cib_types.h.

◆ ping

int(* cib_api_operations_s::ping) (cib_t *cib, xmlNode **output_data, int call_options)

Definition at line 195 of file cib_types.h.

◆ query

int(* cib_api_operations_s::query) (cib_t *cib, const char *section, xmlNode **output_data, int call_options)

Definition at line 198 of file cib_types.h.

◆ query_from

int(* cib_api_operations_s::query_from) (cib_t *cib, const char *host, const char *section, xmlNode **output_data, int call_options)

Definition at line 201 of file cib_types.h.

◆ quit

int(* cib_api_operations_s::quit) (cib_t *cib, int call_options)
Deprecated:
This method is not implemented and should not be used

Definition at line 246 of file cib_types.h.

◆ register_callback

gboolean(* cib_api_operations_s::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 at line 250 of file cib_types.h.

◆ register_callback_full

gboolean(* cib_api_operations_s::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 at line 255 of file cib_types.h.

◆ register_notification

int(* cib_api_operations_s::register_notification) (cib_t *cib, const char *callback, int enabled)

Definition at line 248 of file cib_types.h.

◆ remove

int(* cib_api_operations_s::remove) (cib_t *cib, const char *section, xmlNode *data, int call_options)

Definition at line 237 of file cib_types.h.

◆ replace

int(* cib_api_operations_s::replace) (cib_t *cib, const char *section, xmlNode *data, int call_options)

Definition at line 235 of file cib_types.h.

◆ set_connection_dnotify

int(* cib_api_operations_s::set_connection_dnotify) (cib_t *cib, void(*dnotify)(gpointer user_data))

Definition at line 185 of file cib_types.h.

◆ set_master

int(* cib_api_operations_s::set_master) (cib_t *cib, int call_options)
Deprecated:
Use the set_primary() method instead

Definition at line 208 of file cib_types.h.

◆ set_op_callback

int(* cib_api_operations_s::set_op_callback) (cib_t *cib, void(*callback)(const xmlNode *msg, int callid, int rc, xmlNode *output))
Deprecated:
This method will be removed and should not be used

Definition at line 171 of file cib_types.h.

◆ set_primary

int(* cib_api_operations_s::set_primary) (cib_t *cib, int call_options)

Set the local CIB manager as the cluster's primary instance.

Parameters
[in,out]cibCIB connection
[in]call_optionsGroup of enum cib_call_options flags
Returns
Legacy Pacemaker return code (in particular, pcmk_ok on success)

Definition at line 270 of file cib_types.h.

◆ set_secondary

int(* cib_api_operations_s::set_secondary) (cib_t *cib, int call_options)

Set the local CIB manager as a secondary instance.

Parameters
[in,out]cibCIB connection
[in]call_optionsGroup of enum cib_call_options flags
Returns
Legacy Pacemaker return code (in particular, pcmk_ok on success)

Definition at line 280 of file cib_types.h.

◆ set_slave

int(* cib_api_operations_s::set_slave) (cib_t *cib, int call_options)
Deprecated:
Use the set_secondary() method instead

Definition at line 211 of file cib_types.h.

◆ set_slave_all

int(* cib_api_operations_s::set_slave_all) (cib_t *cib, int call_options)
Deprecated:
This method will be removed and should not be used

Definition at line 214 of file cib_types.h.

◆ set_user

void(* cib_api_operations_s::set_user) (cib_t *cib, const char *user)

Set the user as whom all CIB requests via methods will be executed.

By default, the value of the CIB_user environment variable is used if set. Otherwise, the current effective user is used.

Parameters
[in,out]cibCIB connection
[in]userName of user whose permissions to use when processing requests

Definition at line 374 of file cib_types.h.

◆ signoff

int(* cib_api_operations_s::signoff) (cib_t *cib)

Definition at line 166 of file cib_types.h.

◆ signon

int(* cib_api_operations_s::signon) (cib_t *cib, const char *name, enum cib_conn_type type)

Definition at line 159 of file cib_types.h.

◆ signon_raw

int(* cib_api_operations_s::signon_raw) (cib_t *cib, const char *name, enum cib_conn_type type, int *event_fd)
Deprecated:
This method will be removed and should not be used

Definition at line 162 of file cib_types.h.

◆ sync

int(* cib_api_operations_s::sync) (cib_t *cib, const char *section, int call_options)

Definition at line 216 of file cib_types.h.

◆ sync_from

int(* cib_api_operations_s::sync_from) (cib_t *cib, const char *host, const char *section, int call_options)

Definition at line 217 of file cib_types.h.

◆ update

int(* cib_api_operations_s::update) (cib_t *cib, const char *section, xmlNode *data, int call_options)
Deprecated:
Use the modify() method instead

Definition at line 232 of file cib_types.h.

◆ upgrade

int(* cib_api_operations_s::upgrade) (cib_t *cib, int call_options)

Definition at line 219 of file cib_types.h.


The documentation for this struct was generated from the following file: