pacemaker 3.0.1-16e74fc4da
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
pe_actions.c File Reference
#include <crm_internal.h>
#include <glib.h>
#include <stdbool.h>
#include <crm/crm.h>
#include <crm/common/xml.h>
#include <crm/common/scheduler_internal.h>
#include <crm/pengine/internal.h>
#include <crm/common/xml_internal.h>
#include "pe_status_private.h"
Include dependency graph for pe_actions.c:

Go to the source code of this file.

Macros

#define sort_return(an_int, why)
 

Functions

xmlNode * pcmk__find_action_config (const pcmk_resource_t *rsc, const char *action_name, guint interval_ms, bool include_disabled)
 
GHashTable * pcmk__unpack_action_rsc_params (const xmlNode *action_xml, GHashTable *node_attrs, pcmk_scheduler_t *scheduler)
 
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)
 
enum pcmk__requires pcmk__action_requires (const pcmk_resource_t *rsc, const char *action_name)
 
enum pcmk__on_fail pcmk__parse_on_fail (const pcmk_resource_t *rsc, const char *action_name, guint interval_ms, const char *value)
 
enum rsc_role_e pcmk__role_after_failure (const pcmk_resource_t *rsc, const char *action_name, enum pcmk__on_fail on_fail, GHashTable *meta)
 
pcmk_action_tcustom_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.
 
pcmk_action_tget_pseudo_op (const char *name, pcmk_scheduler_t *scheduler)
 
pcmk_action_tpe_fence_op (pcmk_node_t *node, const char *op, bool optional, const char *reason, bool priority_delay, pcmk_scheduler_t *scheduler)
 
enum pcmk__action_type get_complex_task (const pcmk_resource_t *rsc, const char *name)
 
pcmk_action_tfind_first_action (const GList *input, const char *uuid, const char *task, const pcmk_node_t *on_node)
 
GList * find_actions (GList *input, const char *key, const pcmk_node_t *on_node)
 
GList * find_actions_exact (GList *input, const char *key, const pcmk_node_t *on_node)
 
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.
 
char * pe__action2reason (const pcmk_action_t *action, enum pcmk__action_flags flag)
 
void pe_action_set_reason (pcmk_action_t *action, const char *reason, bool overwrite)
 
void pe__clear_resource_history (pcmk_resource_t *rsc, const pcmk_node_t *node)
 
int pe__is_newer_op (const xmlNode *xml_a, const xmlNode *xml_b)
 
gint sort_op_by_callid (gconstpointer a, gconstpointer b)
 
pcmk_action_tpe__new_rsc_pseudo_action (pcmk_resource_t *rsc, const char *task, bool optional, bool runnable)
 
void pe__add_action_expected_result (pcmk_action_t *action, int expected_result)
 

Macro Definition Documentation

◆ sort_return

#define sort_return ( an_int,
why )
Value:
do { \
free(a_uuid); \
free(b_uuid); \
crm_trace("%s (%d) %c %s (%d) : %s", \
a_xml_id, a_call_id, an_int>0?'>':an_int<0?'<':'=', \
b_xml_id, b_call_id, why); \
return an_int; \
} while(0)

Definition at line 1572 of file pe_actions.c.

Function Documentation

◆ custom_action()

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.

Parameters
[in,out]rscResource that action is for (if any)
[in,out]keyAction key (must be non-NULL)
[in]taskAction name (must be non-NULL)
[in]on_nodeNode that action is on (if any)
[in]optionalWhether action should be considered optional
[in,out]schedulerScheduler data
Returns
Action object corresponding to arguments (guaranteed not to be NULL)
Note
This function takes ownership of (and might free) key, and scheduler takes ownership of the returned action (the caller should not free it).

Definition at line 1085 of file pe_actions.c.

◆ find_actions()

GList * find_actions ( GList * input,
const char * key,
const pcmk_node_t * on_node )

Definition at line 1415 of file pe_actions.c.

◆ find_actions_exact()

GList * find_actions_exact ( GList * input,
const char * key,
const pcmk_node_t * on_node )

Definition at line 1449 of file pe_actions.c.

◆ find_first_action()

pcmk_action_t * find_first_action ( const GList * input,
const char * uuid,
const char * task,
const pcmk_node_t * on_node )

Definition at line 1386 of file pe_actions.c.

◆ get_complex_task()

enum pcmk__action_type get_complex_task ( const pcmk_resource_t * rsc,
const char * name )

Definition at line 1353 of file pe_actions.c.

◆ get_pseudo_op()

pcmk_action_t * get_pseudo_op ( const char * name,
pcmk_scheduler_t * scheduler )

Definition at line 1132 of file pe_actions.c.

◆ pcmk__action_requires()

enum pcmk__requires pcmk__action_requires ( const pcmk_resource_t * rsc,
const char * action_name )

Definition at line 820 of file pe_actions.c.

◆ pcmk__find_action_config()

xmlNode * pcmk__find_action_config ( const pcmk_resource_t * rsc,
const char * action_name,
guint interval_ms,
bool include_disabled )

Definition at line 137 of file pe_actions.c.

◆ pcmk__parse_on_fail()

enum pcmk__on_fail pcmk__parse_on_fail ( const pcmk_resource_t * rsc,
const char * action_name,
guint interval_ms,
const char * value )

Definition at line 858 of file pe_actions.c.

◆ pcmk__role_after_failure()

enum rsc_role_e pcmk__role_after_failure ( const pcmk_resource_t * rsc,
const char * action_name,
enum pcmk__on_fail on_fail,
GHashTable * meta )

Definition at line 1004 of file pe_actions.c.

◆ pcmk__unpack_action_meta()

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 )

Definition at line 679 of file pe_actions.c.

◆ pcmk__unpack_action_rsc_params()

GHashTable * pcmk__unpack_action_rsc_params ( const xmlNode * action_xml,
GHashTable * node_attrs,
pcmk_scheduler_t * scheduler )

Definition at line 247 of file pe_actions.c.

◆ pe__action2reason()

char * pe__action2reason ( const pcmk_action_t * action,
enum pcmk__action_flags flag )

Definition at line 1513 of file pe_actions.c.

◆ pe__add_action_expected_result()

void pe__add_action_expected_result ( pcmk_action_t * action,
int expected_result )

Definition at line 1746 of file pe_actions.c.

◆ pe__clear_resource_history()

void pe__clear_resource_history ( pcmk_resource_t * rsc,
const pcmk_node_t * node )

Definition at line 1564 of file pe_actions.c.

◆ pe__is_newer_op()

int pe__is_newer_op ( const xmlNode * xml_a,
const xmlNode * xml_b )

Definition at line 1582 of file pe_actions.c.

◆ pe__new_rsc_pseudo_action()

pcmk_action_t * pe__new_rsc_pseudo_action ( pcmk_resource_t * rsc,
const char * task,
bool optional,
bool runnable )

Definition at line 1720 of file pe_actions.c.

◆ pe__resource_actions()

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.

Parameters
[in]rscResource to search
[in]nodeFind only actions scheduled on this node
[in]taskAction name to search for
[in]require_nodeIf TRUE, NULL node or action node will not match
Returns
List of actions found (or NULL if none)
Note
If node is not NULL and require_node is FALSE, matching actions without a node will be assigned to node.

Definition at line 1487 of file pe_actions.c.

◆ pe_action_set_reason()

void pe_action_set_reason ( pcmk_action_t * action,
const char * reason,
bool overwrite )

Definition at line 1538 of file pe_actions.c.

◆ pe_fence_op()

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 )

Definition at line 1237 of file pe_actions.c.

◆ sort_op_by_callid()

gint sort_op_by_callid ( gconstpointer a,
gconstpointer b )

Definition at line 1703 of file pe_actions.c.