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;
56 guint interval_ms = 0;
58 bool effective_op =
false;
64 effective_op = interval_ms == 0
74 if (best_effective_op) {
80 }
else if (best_interval != 0
82 && interval_ms == 0) {
87 if (!best_failure && failure) {
92 if (best_digest != NULL && digest == NULL) {
103 best_effective_op = effective_op;
104 best_interval = interval_ms;
105 best_failure = failure;
106 best_digest = digest;
124 const char *rsc_type)
127 xmlNode *msg_data = NULL;
133 if (rsc_id == NULL || rsc_type == NULL) {
199 const char *task = NULL;
200 xmlNode *xml_op = NULL;
202 guint interval_ms = 0;
205 if ((out == NULL) || (rsc == NULL) || (node == NULL)) {
208 if (!pcmk__is_primitive(rsc)) {
214 xml_op = best_op(rsc, node);
217 if (xml_op != NULL) {
228 overrides,
true, rsc->
cluster);
229 rc = out->
message(out,
"digests", rsc, node, task, interval_ms, digests);
pcmk_scheduler_t * cluster
int pcmk_resource_delete(xmlNodePtr *xml, const char *rsc_id, const char *rsc_type)
Remove a resource.
cib_t * cib_new(void)
Create a new CIB connection object.
bool pcmk__strcase_any_of(const char *s,...) G_GNUC_NULL_TERMINATED
int(* message)(pcmk__output_t *out, const char *message_id,...)
int pe__is_newer_op(const xmlNode *xml_a, const xmlNode *xml_b, bool same_node_default)
#define PCMK_ACTION_MONITOR
crm_exit_t pcmk_rc2exitc(int rc)
Map a function return code to the most similar exit code.
const char * crm_xml_add(xmlNode *node, const char *name, const char *value)
Create an XML attribute with specified name and value.
void pcmk__xml_output_finish(pcmk__output_t *out, crm_exit_t exit_status, xmlNodePtr *xml)
#define PCMK__XA_OP_RESTART_DIGEST
bool pcmk__ends_with(const char *s, const char *match)
#define PCMK_XA_OPERATION
xmlNode * get_xpath_object(const char *xpath, xmlNode *xml_obj, int error_level)
Wrappers for and extensions to glib mainloop.
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.
cib_api_operations_t * cmds
int(* signon)(cib_t *cib, const char *name, enum cib_conn_type type)
const char * crm_element_value(const xmlNode *data, const char *name)
Retrieve the value of an XML attribute.
xmlNode * pcmk__xe_first_child(const xmlNode *parent, const char *node_name, const char *attr_n, const char *attr_v)
int pcmk__xml_output_new(pcmk__output_t **out, xmlNodePtr *xml)
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)
int pcmk_resource_digests(xmlNodePtr *xml, pcmk_resource_t *rsc, const pcmk_node_t *node, GHashTable *overrides)
Calculate and output resource operation digests.
char * crm_strdup_printf(char const *format,...) G_GNUC_PRINTF(1
struct pe_node_shared_s * details
#define PCMK_ACTION_START
void pcmk__register_lib_messages(pcmk__output_t *out)
int pcmk_legacy2rc(int legacy_rc)
void pe__free_digests(gpointer ptr)
void free_xml(xmlNode *child)
int cib__clean_up_connection(cib_t **cib)
Function and executable result codes.
#define PCMK_META_INTERVAL
#define PCMK__XE_LRM_RSC_OP
#define PCMK_ACTION_MIGRATE_FROM
This structure contains everything that makes up a single output formatter.
int pcmk__resource_delete(cib_t *cib, uint32_t cib_opts, const char *rsc_id, const char *rsc_type)
#define PCMK_ACTION_PROMOTE
int(* remove)(cib_t *cib, const char *section, xmlNode *data, int call_options)
xmlNode * pcmk__xe_create(xmlNode *parent, const char *name)
xmlNode * pcmk__xe_next_same(const xmlNode *node)
#define PCMK_XE_RESOURCES
int pcmk__resource_digests(pcmk__output_t *out, pcmk_resource_t *rsc, const pcmk_node_t *node, GHashTable *overrides)