10 #ifndef PE_INTERNAL__H 11 # define PE_INTERNAL__H 50 bool optional,
bool runnable);
53 bool any_promoting,
bool any_demoting);
95 const char *target_role,
bool show_nodes);
98 ...) G_GNUC_NULL_TERMINATED;
148 time_t *last_failure, uint32_t
flags,
149 const xmlNode *xml_op);
159 unsigned int *count_clean);
162 unsigned int *count);
173 const
char *comment, GHashTable *nodes,
176 #define pe__show_node_scores(level, rsc, text, nodes, scheduler) \ 177 pe__show_node_scores_as(__FILE__, __func__, __LINE__, \ 178 (level), (rsc), (text), (nodes), (scheduler)) 182 const char *action_name, guint interval_ms,
183 const xmlNode *action_config);
185 GHashTable *node_attrs,
188 const char *action_name, guint interval_ms,
189 bool include_disabled);
192 const char *action_name);
195 const char *action_name,
200 const char *action_name,
208 # define delete_key(rsc) pcmk__op_key(rsc->id, PCMK_ACTION_DELETE, 0) 209 # define delete_action(rsc, node, optional) custom_action( \ 210 rsc, delete_key(rsc), PCMK_ACTION_DELETE, node, \ 211 optional, rsc->cluster); 213 # define stop_key(rsc) pcmk__op_key(rsc->id, PCMK_ACTION_STOP, 0) 214 # define stop_action(rsc, node, optional) custom_action( \ 215 rsc, stop_key(rsc), PCMK_ACTION_STOP, node, \ 216 optional, rsc->cluster); 218 # define reload_key(rsc) pcmk__op_key(rsc->id, PCMK_ACTION_RELOAD_AGENT, 0) 219 # define start_key(rsc) pcmk__op_key(rsc->id, PCMK_ACTION_START, 0) 220 # define start_action(rsc, node, optional) custom_action( \ 221 rsc, start_key(rsc), PCMK_ACTION_START, node, \ 222 optional, rsc->cluster) 224 # define promote_key(rsc) pcmk__op_key(rsc->id, PCMK_ACTION_PROMOTE, 0) 225 # define promote_action(rsc, node, optional) custom_action( \ 226 rsc, promote_key(rsc), PCMK_ACTION_PROMOTE, node, \ 227 optional, rsc->cluster) 229 # define demote_key(rsc) pcmk__op_key(rsc->id, PCMK_ACTION_DEMOTE, 0) 230 # define demote_action(rsc, node, optional) custom_action( \ 231 rsc, demote_key(rsc), PCMK_ACTION_DEMOTE, node, \ 232 optional, rsc->cluster) 244 const char *task,
bool require_node);
252 bool same_node_default);
272 if (
id && rsc && rsc->
id) {
276 return (strlen(
id) == base_len) && !strncmp(
id, rsc->
id, base_len);
289 const xmlNode *xml_op,
290 GHashTable *overrides,
297 const xmlNode *xml_op,
302 const char *reason,
bool priority_delay,
318 gboolean
add_tag_ref(GHashTable * tags,
const char * tag_name,
const char * obj_ref);
322 void * print_data, gboolean print_all);
325 const char *reason,
bool priority_delay);
332 const pcmk_node_t *node,
long options,
void *print_data);
335 unsigned int options);
338 unsigned int options);
385 GHashTable *hash,
const char *always_first,
409 gboolean check_parent);
411 gboolean check_parent);
413 gboolean check_parent);
415 gboolean check_parent);
gboolean native_active(pcmk_resource_t *rsc, gboolean all)
const pcmk_resource_t * pe__const_top_resource(const pcmk_resource_t *rsc, bool include_bundle)
void pe__count_bundle(pcmk_resource_t *rsc)
bool pe_can_fence(const pcmk_scheduler_t *scheduler, const pcmk_node_t *node)
void pe__create_clone_notif_pseudo_ops(pcmk_resource_t *clone, pcmk_action_t *start, pcmk_action_t *started, pcmk_action_t *stop, pcmk_action_t *stopped)
bool pe__shutdown_requested(const pcmk_node_t *node)
pcmk_ticket_t * ticket_new(const char *ticket_id, pcmk_scheduler_t *scheduler)
pcmk_node_t * pe__copy_node(const pcmk_node_t *this_node)
void trigger_unfencing(pcmk_resource_t *rsc, pcmk_node_t *node, const char *reason, pcmk_action_t *dependency, pcmk_scheduler_t *scheduler)
pcmk_action_t * get_pseudo_op(const char *name, pcmk_scheduler_t *scheduler)
bool pe__is_universal_clone(const pcmk_resource_t *rsc, const pcmk_scheduler_t *scheduler)
void pe__free_bundle(pcmk_resource_t *rsc)
pcmk_resource_t * pe__find_bundle_replica(const pcmk_resource_t *bundle, const pcmk_node_t *node)
gchar * pcmk__native_output_string(const pcmk_resource_t *rsc, const char *name, const pcmk_node_t *node, uint32_t show_opts, const char *target_role, bool show_nodes)
pcmk_node_t * pe__find_active_requires(const pcmk_resource_t *rsc, unsigned int *count)
gint pe__cmp_node_name(gconstpointer a, gconstpointer b)
xmlNode * pe__failed_probe_for_rsc(const pcmk_resource_t *rsc, const char *name)
pcmk__op_digest_t * rsc_action_digest_cmp(pcmk_resource_t *rsc, const xmlNode *xml_op, pcmk_node_t *node, pcmk_scheduler_t *scheduler)
int pe__target_rc_from_xml(const xmlNode *xml_op)
void pe__foreach_bundle_replica(pcmk_resource_t *bundle, bool(*fn)(pcmk__bundle_replica_t *, void *), void *user_data)
const char * pe__add_bundle_remote_name(pcmk_resource_t *rsc, xmlNode *xml, const char *field)
gboolean get_target_role(const pcmk_resource_t *rsc, enum rsc_role_e *role)
int pe__is_newer_op(const xmlNode *xml_a, const xmlNode *xml_b, bool same_node_default)
int pe__group_default(pcmk__output_t *out, va_list args)
const char * pe__resource_description(const pcmk_resource_t *rsc, uint32_t show_opts)
void common_print(pcmk_resource_t *rsc, const char *pre_text, const char *name, const pcmk_node_t *node, long options, void *print_data)
GHashTable * pcmk__unpack_action_rsc_params(const xmlNode *action_xml, GHashTable *node_attrs, pcmk_scheduler_t *data_set)
pcmk_action_t * pe_fence_op(pcmk_node_t *node, const char *op, bool optional, const char *reason, bool priority_delay, pcmk_scheduler_t *scheduler)
int pe__clone_max(const pcmk_resource_t *clone)
void pe_action_set_reason(pcmk_action_t *action, const char *reason, bool overwrite)
pcmk_node_t * pe_create_node(const char *id, const char *uname, const char *type, int score, pcmk_scheduler_t *scheduler)
int pe__clone_default(pcmk__output_t *out, va_list args)
void print_rscs_brief(GList *rsc_list, const char *pre_text, long options, void *print_data, gboolean print_all)
gint sort_op_by_callid(gconstpointer a, gconstpointer b)
enum rsc_role_e native_resource_state(const pcmk_resource_t *rsc, gboolean current)
GList * pe__rscs_with_tag(pcmk_scheduler_t *scheduler, const char *tag_name)
void pe_fence_node(pcmk_scheduler_t *scheduler, pcmk_node_t *node, const char *reason, bool priority_delay)
Schedule a fence action for a node.
GList * pe__build_rsc_list(pcmk_scheduler_t *scheduler, const char *s)
pcmk_action_t * pe__clear_failcount(pcmk_resource_t *rsc, const pcmk_node_t *node, const char *reason, pcmk_scheduler_t *scheduler)
Schedule a controller operation to clear a fail count.
void pe__foreach_const_bundle_replica(const pcmk_resource_t *bundle, bool(*fn)(const pcmk__bundle_replica_t *, void *), void *user_data)
enum crm_ais_msg_types type
enum pcmk__health_strategy pcmk__parse_health_strategy(const char *value)
void pe__set_resource_flags_recursive(pcmk_resource_t *rsc, uint64_t flags)
const char * pcmk__cluster_option(GHashTable *options, const char *name)
GList * pe__resource_actions(const pcmk_resource_t *rsc, const pcmk_node_t *node, const char *task, bool require_node)
Find all actions of given type for a resource.
int pe__resource_text(pcmk__output_t *out, va_list args)
void pe__foreach_param_check(pcmk_scheduler_t *scheduler, void(*cb)(pcmk_resource_t *, pcmk_node_t *, const xmlNode *, enum pcmk__check_parameters))
int pe__set_clone_flag(pcmk_resource_t *clone, enum pcmk__clone_flags flag)
int pe_get_failcount(const pcmk_node_t *node, pcmk_resource_t *rsc, time_t *last_failure, uint32_t flags, const xmlNode *xml_op)
gboolean clone_unpack(pcmk_resource_t *rsc, pcmk_scheduler_t *scheduler)
int pe__bundle_html(pcmk__output_t *out, va_list args)
GList * pe__filter_rsc_list(GList *rscs, GList *filter)
gboolean native_unpack(pcmk_resource_t *rsc, pcmk_scheduler_t *scheduler)
void pe__print_bundle(pcmk_resource_t *rsc, const char *pre_text, long options, void *print_data)
gboolean group_unpack(pcmk_resource_t *rsc, pcmk_scheduler_t *scheduler)
pcmk_action_t * pe__new_rsc_pseudo_action(pcmk_resource_t *rsc, const char *task, bool optional, bool runnable)
void pe__clear_resource_flags_on_all(pcmk_scheduler_t *scheduler, uint64_t flag)
GList * find_actions_exact(GList *input, const char *key, const pcmk_node_t *on_node)
void common_free(pcmk_resource_t *rsc)
Formatted output for pacemaker tools.
gboolean clone_active(pcmk_resource_t *rsc, gboolean all)
void pe__set_next_role(pcmk_resource_t *rsc, enum rsc_role_e role, const char *why)
int pe__rscs_brief_output(pcmk__output_t *out, GList *rsc_list, unsigned int options)
int pe__bundle_text(pcmk__output_t *out, va_list args)
int pe__bundle_max(const pcmk_resource_t *rsc)
gboolean pe__bundle_is_filtered(const pcmk_resource_t *rsc, GList *only_rsc, gboolean check_parent)
gboolean pe__clone_is_filtered(const pcmk_resource_t *rsc, GList *only_rsc, gboolean check_parent)
const pcmk_resource_t * pe__get_rsc_in_container(const pcmk_resource_t *instance)
pcmk_resource_t * pe__last_group_member(const pcmk_resource_t *group)
int pe__name_and_nvpairs_xml(pcmk__output_t *out, bool is_list, const char *tag_name,...) G_GNUC_NULL_TERMINATED
void resource_location(pcmk_resource_t *rsc, const pcmk_node_t *node, int score, const char *tag, pcmk_scheduler_t *scheduler)
char * clone_strip(const char *last_rsc_id)
void pe__free_param_checks(pcmk_scheduler_t *scheduler)
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 pe__clone_xml(pcmk__output_t *out, va_list args)
bool pe__rsc_running_on_any(pcmk_resource_t *rsc, GList *node_list)
int pe__node_health(pcmk_node_t *node)
enum rsc_start_requirement pcmk__action_requires(const pcmk_resource_t *rsc, const char *action_name)
enum rsc_role_e clone_resource_state(const pcmk_resource_t *rsc, gboolean current)
bool pe__bundle_needs_remote_name(pcmk_resource_t *rsc)
void pe__create_promotable_pseudo_ops(pcmk_resource_t *clone, bool any_promoting, bool any_demoting)
GList * pe__unames_with_tag(pcmk_scheduler_t *scheduler, const char *tag_name)
void pe__show_node_scores_as(const char *file, const char *function, int line, bool to_log, const pcmk_resource_t *rsc, const char *comment, GHashTable *nodes, pcmk_scheduler_t *scheduler)
Wrappers for and extensions to libxml2.
gboolean add_tag_ref(GHashTable *tags, const char *tag_name, const char *obj_ref)
void group_free(pcmk_resource_t *rsc)
void native_free(pcmk_resource_t *rsc)
void pe__unpack_dataset_nvpairs(const xmlNode *xml_obj, const char *set_name, const pe_rule_eval_data_t *rule_data, GHashTable *hash, const char *always_first, gboolean overwrite, pcmk_scheduler_t *scheduler)
GHashTable * pe__node_list2table(const GList *list)
enum rsc_role_e pe__bundle_resource_state(const pcmk_resource_t *rsc, gboolean current)
void group_print(pcmk_resource_t *rsc, const char *pre_text, long options, void *print_data)
GList * pe__build_node_name_list(pcmk_scheduler_t *scheduler, const char *s)
bool pe__clone_flag_is_set(const pcmk_resource_t *clone, uint32_t flags)
void pe__free_digests(gpointer ptr)
void pe__register_messages(pcmk__output_t *out)
bool pe__rsc_has_tag(pcmk_scheduler_t *scheduler, const char *rsc, const char *tag)
bool is_set_recursive(const pcmk_resource_t *rsc, long long flag, bool any)
gboolean group_active(pcmk_resource_t *rsc, gboolean all)
int pe__clone_promoted_node_max(const pcmk_resource_t *clone)
gboolean order_actions(pcmk_action_t *first, pcmk_action_t *then, uint32_t flags)
int pe__clone_promoted_max(const pcmk_resource_t *clone)
void pe__update_recheck_time(time_t recheck, pcmk_scheduler_t *scheduler, const char *reason)
void native_add_running(pcmk_resource_t *rsc, pcmk_node_t *node, pcmk_scheduler_t *scheduler, gboolean failed)
pcmk_action_t * custom_action(pcmk_resource_t *rsc, char *key, const char *task, const pcmk_node_t *on_node, gboolean optional, pcmk_scheduler_t *scheduler)
Create or update an action object.
int pe__resource_xml(pcmk__output_t *out, va_list args)
A single instance of a bundle.
void pe__add_action_expected_result(pcmk_action_t *action, int expected_result)
#define PCMK_OPT_NODE_HEALTH_STRATEGY
char * native_parameter(pcmk_resource_t *rsc, pcmk_node_t *node, gboolean create, const char *name, pcmk_scheduler_t *scheduler)
pcmk_resource_t * native_find_rsc(pcmk_resource_t *rsc, const char *id, const pcmk_node_t *node, int flags)
gboolean pe__native_is_filtered(const pcmk_resource_t *rsc, GList *only_rsc, gboolean check_parent)
int pe__bundle_xml(pcmk__output_t *out, va_list args)
xmlNode * pcmk__find_action_config(const pcmk_resource_t *rsc, const char *action_name, guint interval_ms, bool include_disabled)
void clone_print(pcmk_resource_t *rsc, const char *pre_text, long options, void *print_data)
int pe__common_output_html(pcmk__output_t *out, const pcmk_resource_t *rsc, const char *name, const pcmk_node_t *node, unsigned int options)
Cluster status and scheduling.
gboolean pe__unpack_bundle(pcmk_resource_t *rsc, pcmk_scheduler_t *scheduler)
void pe__create_clone_notifications(pcmk_resource_t *clone)
int pe__node_text(pcmk__output_t *out, va_list args)
gboolean pe__bundle_active(pcmk_resource_t *rsc, gboolean all)
void pe__clear_resource_flags_recursive(pcmk_resource_t *rsc, uint64_t flags)
void pe__free_clone_notification_data(pcmk_resource_t *clone)
void pe__order_notifs_after_fencing(const pcmk_action_t *action, pcmk_resource_t *rsc, pcmk_action_t *stonith_op)
pcmk_action_t * find_first_action(const GList *input, const char *uuid, const char *task, const pcmk_node_t *on_node)
pcmk_scheduler_t * scheduler
int pe__common_output_text(pcmk__output_t *out, const pcmk_resource_t *rsc, const char *name, const pcmk_node_t *node, unsigned int options)
GList * find_actions(GList *input, const char *key, const pcmk_node_t *on_node)
pcmk_resource_t * pe__first_container(const pcmk_resource_t *bundle)
char * clone_zero(const char *last_rsc_id)
bool pcmk__rsc_filtered_by_node(pcmk_resource_t *rsc, GList *only_node)
int pe__node_xml(pcmk__output_t *out, va_list args)
int pe__group_xml(pcmk__output_t *out, va_list args)
This structure contains everything that makes up a single output formatter.
bool pe__resource_is_disabled(const pcmk_resource_t *rsc)
bool pe__uname_has_tag(pcmk_scheduler_t *scheduler, const char *node, const char *tag)
void pe_free_action(pcmk_action_t *action)
void pe__count_common(pcmk_resource_t *rsc)
char * pe__node_display_name(pcmk_node_t *node, bool print_detail)
int pe__resource_html(pcmk__output_t *out, va_list args)
int pe__clone_node_max(const pcmk_resource_t *clone)
void pe__clear_resource_history(pcmk_resource_t *rsc, const pcmk_node_t *node)
void destroy_ticket(gpointer data)
void clone_free(pcmk_resource_t *rsc)
int pe__node_html(pcmk__output_t *out, va_list args)
pcmk_resource_t * pe__bundled_resource(const pcmk_resource_t *rsc)
enum rsc_role_e group_resource_state(const pcmk_resource_t *rsc, gboolean current)
enum action_fail_response pcmk__parse_on_fail(const pcmk_resource_t *rsc, const char *action_name, guint interval_ms, const char *value)
bool pe__count_active_node(const pcmk_resource_t *rsc, pcmk_node_t *node, pcmk_node_t **active, unsigned int *count_all, unsigned int *count_clean)
int pe__sum_node_health_scores(const pcmk_node_t *node, int base_health)
bool pe__clone_is_ordered(const pcmk_resource_t *clone)
pcmk_node_t * native_location(const pcmk_resource_t *rsc, GList **list, int current)
bool pe__rsc_running_on_only(const pcmk_resource_t *rsc, const pcmk_node_t *node)
pcmk_resource_t * find_clone_instance(const pcmk_resource_t *rsc, const char *sub_id)
bool pe__group_flag_is_set(const pcmk_resource_t *group, uint32_t flags)
char * pe__action2reason(const pcmk_action_t *action, enum pe_action_flags flag)
enum rsc_role_e pcmk__role_after_failure(const pcmk_resource_t *rsc, const char *action_name, enum action_fail_response on_fail, GHashTable *meta)
bool pe__node_is_bundle_instance(const pcmk_resource_t *bundle, const pcmk_node_t *node)
enum action_tasks get_complex_task(const pcmk_resource_t *rsc, const char *name)
time_t get_effective_time(pcmk_scheduler_t *scheduler)
gboolean pe__group_is_filtered(const pcmk_resource_t *rsc, GList *only_rsc, gboolean check_parent)
const char * pe_base_name_end(const char *id)
const char * pe__clone_child_id(const pcmk_resource_t *rsc)
void pe__add_param_check(const xmlNode *rsc_op, pcmk_resource_t *rsc, pcmk_node_t *node, enum pcmk__check_parameters, pcmk_scheduler_t *scheduler)
GList * pe__bundle_containers(const pcmk_resource_t *bundle)
GHashTable * pcmk__unpack_action_meta(pcmk_resource_t *rsc, const pcmk_node_t *node, const char *action_name, guint interval_ms, const xmlNode *action_config)
void native_print(pcmk_resource_t *rsc, const char *pre_text, long options, void *print_data)