pacemaker  2.0.1-15814c6c0d
Scalable High-Availability cluster resource manager
util.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2004 Andrew Beekhof <andrew@beekhof.net>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This software is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 #ifndef CIB_UTIL__H
19 # define CIB_UTIL__H
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 /* Utility functions */
26 const char *get_object_path(const char *object_type);
27 const char *get_object_parent(const char *object_type);
28 xmlNode *get_object_root(const char *object_type, xmlNode * the_root);
29 xmlNode *create_cib_fragment_adv(xmlNode * update, const char *section, const char *source);
30 
31 xmlNode *createEmptyCib(int admin_epoch);
32 gboolean verifyCibXml(xmlNode * cib);
33 
34 gboolean cib_version_details(xmlNode * cib, int *admin_epoch, int *epoch, int *updates);
35 
36 int update_attr_delegate(cib_t * the_cib, int call_options,
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  const char *attr_value, gboolean to_console,
41  const char *user_name, const char *node_type);
42 
43 int find_nvpair_attr_delegate(cib_t * the_cib, const char *attr,
44  const char *section, const char *node_uuid,
45  const char *set_type, const char *set_name,
46  const char *attr_id, const char *attr_name,
47  gboolean to_console, char **value, const char *user_name);
48 
49 int read_attr_delegate(cib_t * the_cib,
50  const char *section, const char *node_uuid,
51  const char *set_type, const char *set_name,
52  const char *attr_id, const char *attr_name,
53  char **attr_value, gboolean to_console, const char *user_name);
54 
55 int delete_attr_delegate(cib_t * the_cib, int options,
56  const char *section, const char *node_uuid,
57  const char *set_type, const char *set_name,
58  const char *attr_id, const char *attr_name,
59  const char *attr_value, gboolean to_console, const char *user_name);
60 
61 int query_node_uuid(cib_t * the_cib, const char *uname, char **uuid, int *is_remote_node);
62 
63 int query_node_uname(cib_t * the_cib, const char *uuid, char **uname);
64 
65 int set_standby(cib_t * the_cib, const char *uuid, const char *scope, const char *standby_value);
66 
67 xmlNode *cib_get_generation(cib_t * cib);
68 
69 void cib_metadata(void);
70 const char *cib_pref(GHashTable * options, const char *name);
71 int cib_apply_patch_event(xmlNode * event, xmlNode * input, xmlNode ** output, int level);
72 
73 #ifdef __cplusplus
74 }
75 #endif
76 
77 #endif
char uname[MAX_NAME]
Definition: internal.h:82
gboolean cib_version_details(xmlNode *cib, int *admin_epoch, int *epoch, int *updates)
Definition: cib_utils.c:81
gboolean verifyCibXml(xmlNode *cib)
xmlNode * get_object_root(const char *object_type, xmlNode *the_root)
Definition: cib_utils.c:152
const char * get_object_path(const char *object_type)
Definition: cib_utils.c:123
int query_node_uuid(cib_t *the_cib, const char *uname, char **uuid, int *is_remote_node)
Definition: cib_attrs.c:489
int set_standby(cib_t *the_cib, const char *uuid, const char *scope, const char *standby_value)
Definition: cib_attrs.c:571
const char * get_object_parent(const char *object_type)
Definition: cib_utils.c:138
xmlNode * cib_get_generation(cib_t *cib)
Definition: cib_utils.c:66
gboolean is_remote_node(node_t *node)
Definition: remote.c:52
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:331
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:56
int query_node_uname(cib_t *the_cib, const char *uuid, char **uname)
Definition: cib_attrs.c:527
xmlNode * createEmptyCib(int admin_epoch)
Definition: cib_utils.c:168
node_type
Definition: status.h:40
int cib_apply_patch_event(xmlNode *event, xmlNode *input, xmlNode **output, int level)
Definition: cib_utils.c:697
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:354
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:176
const char * cib_pref(GHashTable *options, const char *name)
Definition: cib_utils.c:664
void cib_metadata(void)
Definition: cib_utils.c:649
Definition: cib.h:140
xmlNode * create_cib_fragment_adv(xmlNode *update, const char *section, const char *source)