14#include <libxml/tree.h>
26#define XPATH_OP_HISTORY "//" PCMK_XE_STATUS \
27 "/" PCMK__XE_NODE_STATE \
28 "[@" PCMK_XA_UNAME "='%s']" \
29 "/" PCMK__XE_LRM "/" PCMK__XE_LRM_RESOURCES \
30 "/" PCMK__XE_LRM_RESOURCE "[@" PCMK_XA_ID "='%s']"
36 xmlNode *history = NULL;
38 bool best_effective_op =
false;
39 guint best_interval = 0;
40 bool best_failure =
false;
41 const char *best_digest = NULL;
58 guint interval_ms = 0;
60 bool effective_op =
false;
66 effective_op = interval_ms == 0
76 if (best_effective_op) {
82 }
else if (best_interval != 0
84 && interval_ms == 0) {
89 if (!best_failure && failure) {
94 if (best_digest != NULL && digest == NULL) {
105 best_effective_op = effective_op;
106 best_interval = interval_ms;
107 best_failure = failure;
108 best_digest = digest;
126 const char *rsc_type)
129 xmlNode *msg_data = NULL;
135 if (rsc_id == NULL || rsc_type == NULL) {
201 const char *task = NULL;
202 xmlNode *xml_op = NULL;
204 guint interval_ms = 0;
207 if ((out == NULL) || (rsc == NULL) || (node == NULL)) {
211 if (!pcmk__is_primitive(rsc)) {
217 xml_op = best_op(rsc, node);
220 if (xml_op != NULL) {
232 rc = out->
message(out,
"digests", rsc, node, task, interval_ms, digests);
#define PCMK_ACTION_PROMOTE
#define PCMK_ACTION_START
#define PCMK_ACTION_MIGRATE_FROM
#define PCMK_ACTION_MONITOR
int cib__clean_up_connection(cib_t **cib)
cib_t * cib_new(void)
Create a new CIB connection object.
Wrappers for and extensions to glib mainloop.
#define PCMK_META_INTERVAL
Formatted output for pacemaker tools.
void pcmk__xml_output_finish(pcmk__output_t *out, crm_exit_t exit_status, xmlNodePtr *xml)
int pcmk__xml_output_new(pcmk__output_t **out, xmlNodePtr *xml)
int pcmk__resource_delete(cib_t *cib, uint32_t cib_opts, const char *rsc_id, const char *rsc_type)
int pcmk_resource_digests(xmlNodePtr *xml, pcmk_resource_t *rsc, const pcmk_node_t *node, GHashTable *overrides)
Calculate and output resource operation digests.
int pcmk__resource_digests(pcmk__output_t *out, pcmk_resource_t *rsc, const pcmk_node_t *node, GHashTable *overrides)
int pcmk_resource_delete(xmlNodePtr *xml, const char *rsc_id, const char *rsc_type)
Remove a resource.
void pcmk__register_lib_messages(pcmk__output_t *out)
pcmk__op_digest_t * pe__calculate_digests(pcmk_resource_t *rsc, const char *task, guint *interval_ms, const pcmk_node_t *node, const xmlNode *xml_op, GHashTable *overrides, bool calc_secure, pcmk_scheduler_t *scheduler)
void pe__free_digests(gpointer ptr)
int pe__is_newer_op(const xmlNode *xml_a, const xmlNode *xml_b)
Function and executable result codes.
int pcmk_legacy2rc(int legacy_rc)
crm_exit_t pcmk_rc2exitc(int rc)
Map a function return code to the most similar exit code.
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
bool pcmk__strcase_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
bool pcmk__ends_with(const char *s, const char *match)
int(* remove)(cib_t *cib, const char *section, xmlNode *data, int call_options)
int(* signon)(cib_t *cib, const char *name, enum cib_conn_type type)
cib_api_operations_t * cmds
This structure contains everything that makes up a single output formatter.
int(* message)(pcmk__output_t *out, const char *message_id,...)
pcmk_scheduler_t * scheduler
pcmk__resource_private_t * priv
pcmk__node_private_t * priv
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
int crm_element_value_ms(const xmlNode *data, const char *name, guint *dest)
Retrieve the millisecond value of an XML attribute.
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
xmlNode * pcmk__xe_first_child(const xmlNode *parent, const char *node_name, const char *attr_n, const char *attr_v)
xmlNode * pcmk__xe_next(const xmlNode *node, const char *element_name)
xmlNode * pcmk__xe_create(xmlNode *parent, const char *name)
void pcmk__xml_free(xmlNode *xml)
#define PCMK_XA_OPERATION
#define PCMK_XE_RESOURCES
#define PCMK__XE_LRM_RSC_OP
#define PCMK__XA_OP_RESTART_DIGEST
xmlNode * pcmk__xpath_find_one(xmlDoc *doc, const char *path, uint8_t level)