pacemaker  2.1.3-ea053b43a
Scalable High-Availability cluster resource manager
Macros | Functions
cib_attrs.c File Reference
#include <crm_internal.h>
#include <sys/param.h>
#include <crm/crm.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
#include <fcntl.h>
#include <libgen.h>
#include <crm/msg_xml.h>
#include <crm/common/xml.h>
#include <crm/common/xml_internal.h>
#include <crm/common/output_internal.h>
#include <crm/cib/internal.h>
Include dependency graph for cib_attrs.c:

Go to the source code of this file.

Macros

#define attr_snprintf(_str, _offset, _limit, ...)
 
#define XPATH_MAX   1024
 
#define XPATH_UPPER_TRANS   "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
 
#define XPATH_LOWER_TRANS   "abcdefghijklmnopqrstuvwxyz"
 
#define XPATH_NODE
 

Functions

int cib__update_node_attr (pcmk__output_t *out, cib_t *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, const char *user_name, const char *node_type)
 
int cib__read_node_attr (pcmk__output_t *out, cib_t *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, const char *user_name)
 
int cib__delete_node_attr (pcmk__output_t *out, cib_t *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, const char *user_name)
 
int find_nvpair_attr_delegate (cib_t *cib, const char *attr, const char *section, const char *node_uuid, const char *attr_set_type, const char *set_name, const char *attr_id, const char *attr_name, gboolean to_console, char **value, const char *user_name)
 
int update_attr_delegate (cib_t *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 read_attr_delegate (cib_t *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 *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)
 

Macro Definition Documentation

◆ attr_snprintf

#define attr_snprintf (   _str,
  _offset,
  _limit,
  ... 
)
Value:
do { \
_offset += snprintf(_str + _offset, \
(_limit > _offset) ? _limit - _offset : 0, \
__VA_ARGS__); \
} while(0)

Definition at line 32 of file cib_attrs.c.

◆ XPATH_LOWER_TRANS

#define XPATH_LOWER_TRANS   "abcdefghijklmnopqrstuvwxyz"

Definition at line 583 of file cib_attrs.c.

◆ XPATH_MAX

#define XPATH_MAX   1024

Definition at line 38 of file cib_attrs.c.

◆ XPATH_NODE

#define XPATH_NODE
Value:
"/" XML_CIB_TAG_NODE "[translate(@" XML_ATTR_UNAME ",'" XPATH_UPPER_TRANS "','" XPATH_LOWER_TRANS "') ='%s']" \
"[@class='ocf'][@provider='pacemaker'][@type='remote'][translate(@id,'" XPATH_UPPER_TRANS "','" XPATH_LOWER_TRANS "') ='%s']" \
"[@name='" XML_RSC_ATTR_REMOTE_NODE "'][translate(@value,'" XPATH_UPPER_TRANS "','" XPATH_LOWER_TRANS "') ='%s']" \
"[@" XML_NODE_IS_REMOTE "='true'][translate(@" XML_ATTR_UUID ",'" XPATH_UPPER_TRANS "','" XPATH_LOWER_TRANS "') ='%s']"
#define XPATH_UPPER_TRANS
Definition: cib_attrs.c:582
#define XML_CIB_TAG_NVPAIR
Definition: msg_xml.h:206
#define XML_CIB_TAG_NODES
Definition: msg_xml.h:187
#define XML_CIB_TAG_RESOURCES
Definition: msg_xml.h:186
#define XML_CIB_TAG_RESOURCE
Definition: msg_xml.h:220
#define XML_CIB_TAG_STATE
Definition: msg_xml.h:204
#define XML_TAG_META_SETS
Definition: msg_xml.h:210
#define XML_ATTR_UNAME
Definition: msg_xml.h:157
#define XML_NODE_IS_REMOTE
Definition: msg_xml.h:285
#define XML_RSC_ATTR_REMOTE_NODE
Definition: msg_xml.h:250
#define XML_CIB_TAG_NODE
Definition: msg_xml.h:205
#define XML_ATTR_UUID
Definition: msg_xml.h:158
#define XML_TAG_CIB
Definition: msg_xml.h:115
#define XPATH_LOWER_TRANS
Definition: cib_attrs.c:583
#define XML_CIB_TAG_STATUS
Definition: msg_xml.h:185
#define XML_CIB_TAG_CONFIGURATION
Definition: msg_xml.h:184

Definition at line 584 of file cib_attrs.c.

◆ XPATH_UPPER_TRANS

#define XPATH_UPPER_TRANS   "ABCDEFGHIJKLMNOPQRSTUVWXYZ"

Definition at line 582 of file cib_attrs.c.

Function Documentation

◆ cib__delete_node_attr()

int cib__delete_node_attr ( pcmk__output_t out,
cib_t 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,
const char *  user_name 
)

Definition at line 371 of file cib_attrs.c.

◆ cib__read_node_attr()

int cib__read_node_attr ( pcmk__output_t out,
cib_t 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,
const char *  user_name 
)

Definition at line 347 of file cib_attrs.c.

◆ cib__update_node_attr()

int cib__update_node_attr ( pcmk__output_t out,
cib_t 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,
const char *  user_name,
const char *  node_type 
)

Definition at line 188 of file cib_attrs.c.

◆ delete_attr_delegate()

int delete_attr_delegate ( cib_t 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 cib,
const char *  attr,
const char *  section,
const char *  node_uuid,
const char *  attr_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 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 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.