pacemaker  2.1.4-dc6eb4362
Scalable High-Availability cluster resource manager
util.h
Go to the documentation of this file.
1 /*
2  * Copyright 2004-2021 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_UTIL__H
11 # define PCMK__CRM_CIB_UTIL__H
12 
13 #include <glib.h> // gboolean
14 #include <libxml/tree.h> // xmlNode
15 #include <crm/cib/cib_types.h> // cib_t
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 /* Utility functions */
22 xmlNode *create_cib_fragment_adv(xmlNode * update, const char *section, const char *source);
23 
24 xmlNode *createEmptyCib(int cib_epoch);
25 gboolean verifyCibXml(xmlNode * cib);
26 
27 gboolean cib_version_details(xmlNode * cib, int *admin_epoch, int *epoch, int *updates);
28 
29 int update_attr_delegate(cib_t * the_cib, int call_options,
30  const char *section, const char *node_uuid,
31  const char *set_type, const char *set_name,
32  const char *attr_id, const char *attr_name,
33  const char *attr_value, gboolean to_console,
34  const char *user_name, const char *node_type);
35 
36 int find_nvpair_attr_delegate(cib_t * the_cib, const char *attr,
37  const char *section, const char *node_uuid,
38  const char *set_type, const char *set_name,
39  const char *attr_id, const char *attr_name,
40  gboolean to_console, char **value, const char *user_name);
41 
42 int read_attr_delegate(cib_t * the_cib,
43  const char *section, const char *node_uuid,
44  const char *set_type, const char *set_name,
45  const char *attr_id, const char *attr_name,
46  char **attr_value, gboolean to_console, const char *user_name);
47 
48 int delete_attr_delegate(cib_t * the_cib, int options,
49  const char *section, const char *node_uuid,
50  const char *set_type, const char *set_name,
51  const char *attr_id, const char *attr_name,
52  const char *attr_value, gboolean to_console, const char *user_name);
53 
54 int query_node_uuid(cib_t * the_cib, const char *uname, char **uuid, int *is_remote_node);
55 
56 int query_node_uname(cib_t * the_cib, const char *uuid, char **uname);
57 
58 int set_standby(cib_t * the_cib, const char *uuid, const char *scope, const char *standby_value);
59 
60 xmlNode *cib_get_generation(cib_t * cib);
61 
62 void cib_metadata(void);
63 const char *cib_pref(GHashTable * options, const char *name);
64 
65 int cib_apply_patch_event(xmlNode *event, xmlNode *input, xmlNode **output,
66  int level);
67 
68 #if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
69 #include <crm/cib/util_compat.h>
70 #endif
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #endif
gboolean cib_version_details(xmlNode *cib, int *admin_epoch, int *epoch, int *updates)
Definition: cib_utils.c:43
const char * name
Definition: cib.c:24
gboolean verifyCibXml(xmlNode *cib)
Data types for Cluster Information Base access.
int query_node_uuid(cib_t *the_cib, const char *uname, char **uuid, int *is_remote_node)
Definition: cib_attrs.c:597
int set_standby(cib_t *the_cib, const char *uuid, const char *scope, const char *standby_value)
Definition: cib_attrs.c:685
Deprecated Pacemaker configuration utilities.
xmlNode * cib_get_generation(cib_t *cib)
Definition: cib_utils.c:28
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: cib_attrs.c:458
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: cib_attrs.c:413
int query_node_uname(cib_t *the_cib, const char *uuid, char **uname)
Definition: cib_attrs.c:637
xmlNode * createEmptyCib(int cib_epoch)
Create XML for a new (empty) CIB.
Definition: cib_utils.c:89
int cib_apply_patch_event(xmlNode *event, xmlNode *input, xmlNode **output, int level)
Apply a CIB update patch to a given CIB.
Definition: cib_utils.c:673
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: cib_attrs.c:480
xmlNode * input
node_type
Definition: pe_types.h:71
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: cib_attrs.c:435
char uname[MAX_NAME]
Definition: cpg.c:50
const char * cib_pref(GHashTable *options, const char *name)
Definition: cib_utils.c:590
void cib_metadata(void)
Definition: cib_utils.c:572
xmlNode * create_cib_fragment_adv(xmlNode *update, const char *section, const char *source)