pacemaker 2.1.1-77db578727
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
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 CIB_UTIL__H
11# define 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
18extern "C" {
19#endif
20
21/* Utility functions */
22const char *get_object_path(const char *object_type);
23const char *get_object_parent(const char *object_type);
24xmlNode *get_object_root(const char *object_type, xmlNode * the_root);
25xmlNode *create_cib_fragment_adv(xmlNode * update, const char *section, const char *source);
26
27xmlNode *createEmptyCib(int cib_epoch);
28gboolean verifyCibXml(xmlNode * cib);
29
30gboolean cib_version_details(xmlNode * cib, int *admin_epoch, int *epoch, int *updates);
31
32int update_attr_delegate(cib_t * the_cib, int call_options,
33 const char *section, const char *node_uuid,
34 const char *set_type, const char *set_name,
35 const char *attr_id, const char *attr_name,
36 const char *attr_value, gboolean to_console,
37 const char *user_name, const char *node_type);
38
39int find_nvpair_attr_delegate(cib_t * the_cib, const char *attr,
40 const char *section, const char *node_uuid,
41 const char *set_type, const char *set_name,
42 const char *attr_id, const char *attr_name,
43 gboolean to_console, char **value, const char *user_name);
44
45int read_attr_delegate(cib_t * the_cib,
46 const char *section, const char *node_uuid,
47 const char *set_type, const char *set_name,
48 const char *attr_id, const char *attr_name,
49 char **attr_value, gboolean to_console, const char *user_name);
50
51int delete_attr_delegate(cib_t * the_cib, int options,
52 const char *section, const char *node_uuid,
53 const char *set_type, const char *set_name,
54 const char *attr_id, const char *attr_name,
55 const char *attr_value, gboolean to_console, const char *user_name);
56
57int query_node_uuid(cib_t * the_cib, const char *uname, char **uuid, int *is_remote_node);
58
59int query_node_uname(cib_t * the_cib, const char *uuid, char **uname);
60
61int set_standby(cib_t * the_cib, const char *uuid, const char *scope, const char *standby_value);
62
63xmlNode *cib_get_generation(cib_t * cib);
64
65void cib_metadata(void);
66const char *cib_pref(GHashTable * options, const char *name);
67
68int cib_apply_patch_event(xmlNode *event, xmlNode *input, xmlNode **output,
69 int level);
70
71#ifdef __cplusplus
72}
73#endif
74
75#endif
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:747
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:349
gboolean verifyCibXml(xmlNode *cib)
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:48
int query_node_uname(cib_t *the_cib, const char *uuid, char **uname)
Definition cib_attrs.c:522
int query_node_uuid(cib_t *the_cib, const char *uname, char **uuid, int *is_remote_node)
Definition cib_attrs.c:484
const char * cib_pref(GHashTable *options, const char *name)
Definition cib_utils.c:664
int set_standby(cib_t *the_cib, const char *uuid, const char *scope, const char *standby_value)
Definition cib_attrs.c:570
xmlNode * create_cib_fragment_adv(xmlNode *update, const char *section, const char *source)
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:169
const char * get_object_path(const char *object_type)
Definition cib_utils.c:117
gboolean cib_version_details(xmlNode *cib, int *admin_epoch, int *epoch, int *updates)
Definition cib_utils.c:75
xmlNode * cib_get_generation(cib_t *cib)
Definition cib_utils.c:60
const char * get_object_parent(const char *object_type)
Definition cib_utils.c:132
xmlNode * createEmptyCib(int cib_epoch)
Create XML for a new (empty) CIB.
Definition cib_utils.c:166
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:326
xmlNode * get_object_root(const char *object_type, xmlNode *the_root)
Definition cib_utils.c:146
void cib_metadata(void)
Definition cib_utils.c:648
Data types for Cluster Information Base access.
char uname[MAX_NAME]
Definition cpg.c:5
char * name
Definition pcmk_fence.c:31
node_type
Definition pe_types.h:70