14 #include <libxml/tree.h> 25 #define XPATH_OP_HISTORY "//" XML_CIB_TAG_STATUS \ 26 "/" XML_CIB_TAG_STATE "[@" XML_ATTR_UNAME "='%s']" \ 27 "/" XML_CIB_TAG_LRM "/" XML_LRM_TAG_RESOURCES \ 28 "/" XML_LRM_TAG_RESOURCE "[@" XML_ATTR_ID "='%s']" 35 xmlNode *history = NULL;
37 bool best_effective_op =
false;
38 guint best_interval = 0;
39 bool best_failure =
false;
40 const char *best_digest = NULL;
53 guint interval_ms = 0;
55 bool effective_op =
false;
60 effective_op = interval_ms == 0
69 if (best_effective_op) {
75 }
else if (best_interval != 0
77 && interval_ms == 0) {
82 if (!best_failure && failure) {
87 if (best_digest != NULL && digest == NULL) {
98 best_effective_op = effective_op;
99 best_interval = interval_ms;
100 best_failure = failure;
101 best_digest = digest;
119 const pe_node_t *node, GHashTable *overrides)
121 const char *task = NULL;
122 xmlNode *xml_op = NULL;
124 guint interval_ms = 0;
127 if ((out == NULL) || (rsc == NULL) || (node == NULL)) {
136 xml_op = best_op(rsc, node, rsc->
cluster);
139 if (xml_op != NULL) {
150 overrides,
true, rsc->
cluster);
151 rc = out->
message(out,
"digests", rsc, node, task, interval_ms, digests);
159 const pe_node_t *node, GHashTable *overrides,
bool pcmk__strcase_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
int(* message)(pcmk__output_t *out, const char *message_id,...)
int pcmk_resource_digests(xmlNodePtr *xml, pe_resource_t *rsc, const pe_node_t *node, GHashTable *overrides, pe_working_set_t *data_set)
Calculate and output resource operation digests.
xmlNode * first_named_child(const xmlNode *parent, const char *name)
int pe__is_newer_op(const xmlNode *xml_a, const xmlNode *xml_b, bool same_node_default)
#define XML_LRM_ATTR_INTERVAL
bool pcmk__ends_with(const char *s, const char *match)
xmlNode * get_xpath_object(const char *xpath, xmlNode *xml_obj, int error_level)
Wrappers for and extensions to glib mainloop.
int pcmk__resource_digests(pcmk__output_t *out, pe_resource_t *rsc, const pe_node_t *node, GHashTable *overrides)
#define XML_LRM_ATTR_TASK
Formatted output for pacemaker tools.
int crm_element_value_ms(const xmlNode *data, const char *name, guint *dest)
Retrieve the millisecond value of an XML attribute.
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
int pcmk__xml_output_new(pcmk__output_t **out, xmlNodePtr *xml)
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
struct pe_node_shared_s * details
void pcmk__register_lib_messages(pcmk__output_t *out)
pe_working_set_t * data_set
#define XML_LRM_ATTR_RESTART_DIGEST
void pe__free_digests(gpointer ptr)
enum pe_obj_types variant
Function and executable result codes.
This structure contains everything that makes up a single output formatter.
#define XML_LRM_ATTR_INTERVAL_MS
void pcmk__xml_output_finish(pcmk__output_t *out, xmlNodePtr *xml)
pe_working_set_t * cluster
#define XML_LRM_TAG_RSC_OP
op_digest_cache_t * pe__calculate_digests(pe_resource_t *rsc, const char *task, guint *interval_ms, const pe_node_t *node, const xmlNode *xml_op, GHashTable *overrides, bool calc_secure, pe_working_set_t *data_set)
xmlNode * crm_next_same_xml(const xmlNode *sibling)
Get next instance of same XML tag.