pacemaker  2.1.3-ea053b43a
Scalable High-Availability cluster resource manager
Functions
util.h File Reference
#include <glib.h>
#include <libxml/tree.h>
#include <crm/cib/cib_types.h>
#include <crm/cib/util_compat.h>
Include dependency graph for util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

xmlNode * create_cib_fragment_adv (xmlNode *update, const char *section, const char *source)
 
xmlNode * createEmptyCib (int cib_epoch)
 Create XML for a new (empty) CIB. More...
 
gboolean verifyCibXml (xmlNode *cib)
 
gboolean cib_version_details (xmlNode *cib, int *admin_epoch, int *epoch, int *updates)
 
int update_attr_delegate (cib_t *the_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, gboolean to_console, const char *user_name, const char *node_type)
 
int find_nvpair_attr_delegate (cib_t *the_cib, const char *attr, const char *section, const char *node_uuid, const char *set_type, const char *set_name, const char *attr_id, const char *attr_name, gboolean to_console, char **value, const char *user_name)
 
int read_attr_delegate (cib_t *the_cib, const char *section, const char *node_uuid, const char *set_type, const char *set_name, const char *attr_id, const char *attr_name, char **attr_value, gboolean to_console, const char *user_name)
 
int delete_attr_delegate (cib_t *the_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, gboolean to_console, const char *user_name)
 
int query_node_uuid (cib_t *the_cib, const char *uname, char **uuid, int *is_remote_node)
 
int query_node_uname (cib_t *the_cib, const char *uuid, char **uname)
 
int set_standby (cib_t *the_cib, const char *uuid, const char *scope, const char *standby_value)
 
xmlNode * cib_get_generation (cib_t *cib)
 
void cib_metadata (void)
 
const char * cib_pref (GHashTable *options, const char *name)
 
int cib_apply_patch_event (xmlNode *event, xmlNode *input, xmlNode **output, int level)
 Apply a CIB update patch to a given CIB. More...
 

Function Documentation

◆ cib_apply_patch_event()

int cib_apply_patch_event ( xmlNode *  event,
xmlNode *  input,
xmlNode **  output,
int  level 
)

Apply a CIB update patch to a given CIB.

Parameters
[in]eventCIB update patch
[in]inputCIB to patch
[out]outputResulting CIB after patch
[in]levelLog the patch at this log level (unless LOG_CRIT)
Returns
Legacy Pacemaker return code
Note
sbd calls this function

Definition at line 673 of file cib_utils.c.

◆ cib_get_generation()

xmlNode* cib_get_generation ( cib_t cib)

Definition at line 28 of file cib_utils.c.

◆ cib_metadata()

void cib_metadata ( void  )

Definition at line 572 of file cib_utils.c.

◆ cib_pref()

const char* cib_pref ( GHashTable *  options,
const char *  name 
)

Definition at line 590 of file cib_utils.c.

◆ cib_version_details()

gboolean cib_version_details ( xmlNode *  cib,
int *  admin_epoch,
int *  epoch,
int *  updates 
)

Definition at line 43 of file cib_utils.c.

◆ create_cib_fragment_adv()

xmlNode* create_cib_fragment_adv ( xmlNode *  update,
const char *  section,
const char *  source 
)

◆ createEmptyCib()

xmlNode* createEmptyCib ( int  cib_epoch)

Create XML for a new (empty) CIB.

Parameters
[in]cib_epochWhat to use as "epoch" CIB property
Returns
Newly created XML for empty CIB
Note
It is the caller's responsibility to free the result with free_xml().

Definition at line 89 of file cib_utils.c.

◆ delete_attr_delegate()

int delete_attr_delegate ( cib_t the_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,
gboolean  to_console,
const char *  user_name 
)

Definition at line 480 of file cib_attrs.c.

◆ find_nvpair_attr_delegate()

int find_nvpair_attr_delegate ( cib_t the_cib,
const char *  attr,
const char *  section,
const char *  node_uuid,
const char *  set_type,
const char *  set_name,
const char *  attr_id,
const char *  attr_name,
gboolean  to_console,
char **  value,
const char *  user_name 
)

Definition at line 413 of file cib_attrs.c.

◆ query_node_uname()

int query_node_uname ( cib_t the_cib,
const char *  uuid,
char **  uname 
)

Definition at line 637 of file cib_attrs.c.

◆ query_node_uuid()

int query_node_uuid ( cib_t the_cib,
const char *  uname,
char **  uuid,
int *  is_remote_node 
)

Definition at line 597 of file cib_attrs.c.

◆ read_attr_delegate()

int read_attr_delegate ( cib_t the_cib,
const char *  section,
const char *  node_uuid,
const char *  set_type,
const char *  set_name,
const char *  attr_id,
const char *  attr_name,
char **  attr_value,
gboolean  to_console,
const char *  user_name 
)

Definition at line 458 of file cib_attrs.c.

◆ set_standby()

int set_standby ( cib_t the_cib,
const char *  uuid,
const char *  scope,
const char *  standby_value 
)

Definition at line 685 of file cib_attrs.c.

◆ update_attr_delegate()

int update_attr_delegate ( cib_t the_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,
gboolean  to_console,
const char *  user_name,
const char *  node_type 
)

Definition at line 435 of file cib_attrs.c.

◆ verifyCibXml()

gboolean verifyCibXml ( xmlNode *  cib)