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']" 34 xmlNode *history = NULL;
36 bool best_effective_op =
false;
37 guint best_interval = 0;
38 bool best_failure =
false;
39 const char *best_digest = NULL;
52 guint interval_ms = 0;
54 bool effective_op =
false;
59 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;
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);
139 if (xml_op != NULL) {
150 overrides,
true, rsc->
cluster);
151 rc = out->
message(out,
"digests", rsc, node, task, interval_ms, digests);
int pcmk_resource_digests(xmlNodePtr *xml, pcmk_resource_t *rsc, const pcmk_node_t *node, GHashTable *overrides, pcmk_scheduler_t *scheduler)
Calculate and output resource operation digests.
pcmk_scheduler_t * cluster
Cluster that resource is part of.
bool pcmk__strcase_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
int(* message)(pcmk__output_t *out, const char *message_id,...)
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 PCMK_ACTION_MONITOR
#define XML_LRM_ATTR_INTERVAL
bool pcmk__ends_with(const char *s, const char *match)
Implementation of pcmk_scheduler_t.
xmlNode * get_xpath_object(const char *xpath, xmlNode *xml_obj, int error_level)
Wrappers for and extensions to glib mainloop.
#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.
Implementation of pcmk_resource_t.
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
op_digest_cache_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)
struct pe_node_shared_s * details
Basic node information.
#define PCMK_ACTION_START
const char * uname
Node name in cluster.
void pcmk__register_lib_messages(pcmk__output_t *out)
#define XML_LRM_ATTR_RESTART_DIGEST
void pe__free_digests(gpointer ptr)
Implementation of pcmk_node_t.
enum pe_obj_types variant
Resource variant.
Function and executable result codes.
pcmk_scheduler_t * scheduler
#define PCMK_ACTION_MIGRATE_FROM
This structure contains everything that makes up a single output formatter.
#define XML_LRM_ATTR_INTERVAL_MS
#define PCMK_ACTION_PROMOTE
void pcmk__xml_output_finish(pcmk__output_t *out, xmlNodePtr *xml)
#define XML_LRM_TAG_RSC_OP
int pcmk__resource_digests(pcmk__output_t *out, pcmk_resource_t *rsc, const pcmk_node_t *node, GHashTable *overrides)
char * id
Resource ID in configuration.
xmlNode * crm_next_same_xml(const xmlNode *sibling)
Get next instance of same XML tag.