pacemaker  3.0.0-d8340737c4
Scalable High-Availability cluster resource manager
Data Structures | Macros | Enumerations | Functions
actions_internal.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include <glib.h>
#include <libxml/tree.h>
#include <crm/common/actions.h>
#include <crm/common/roles.h>
#include <crm/common/scheduler_types.h>
#include <crm/common/strings_internal.h>
Include dependency graph for actions_internal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pcmk__action
 

Macros

#define PCMK__OP_FMT   "%s_%s_%u"
 printf-style format to create operation key from resource, action, interval More...
 
#define pcmk__set_action_flags(action, flags_to_set)
 
#define pcmk__clear_action_flags(action, flags_to_clear)
 
#define pcmk__set_raw_action_flags(action_flags, action_name, to_set)
 
#define pcmk__clear_raw_action_flags(action_flags, action_name, to_clear)
 

Enumerations

enum  pcmk__action_type {
  pcmk__action_unspecified = 0, pcmk__action_monitor, pcmk__action_stop, pcmk__action_stopped,
  pcmk__action_start, pcmk__action_started, pcmk__action_notify, pcmk__action_notified,
  pcmk__action_promote, pcmk__action_promoted, pcmk__action_demote, pcmk__action_demoted,
  pcmk__action_shutdown, pcmk__action_fence
}
 
enum  pcmk__action_flags {
  pcmk__no_action_flags = 0, pcmk__action_pseudo = (UINT32_C(1) << 0), pcmk__action_runnable = (UINT32_C(1) << 1), pcmk__action_optional = (UINT32_C(1) << 2),
  pcmk__action_always_in_graph = (UINT32_C(1) << 3), pcmk__action_attrs_evaluated = (UINT32_C(1) << 4), pcmk__action_migratable = (UINT32_C(1) << 7), pcmk__action_added_to_graph = (UINT32_C(1) << 8),
  pcmk__action_migration_abort = (UINT32_C(1) << 11), pcmk__action_reschedule = (UINT32_C(1) << 13), pcmk__action_detect_loop = (UINT32_C(1) << 14), pcmk__action_inputs_deduplicated = (UINT32_C(1) << 15),
  pcmk__action_on_dc = (UINT32_C(1) << 16)
}
 
enum  pcmk__on_fail {
  pcmk__on_fail_ignore, pcmk__on_fail_demote, pcmk__on_fail_restart, pcmk__on_fail_reset_remote,
  pcmk__on_fail_restart_container, pcmk__on_fail_ban, pcmk__on_fail_block, pcmk__on_fail_stop,
  pcmk__on_fail_standby_node, pcmk__on_fail_fence_node
}
 
enum  pcmk__requires { pcmk__requires_nothing = 0, pcmk__requires_quorum = 1, pcmk__requires_fencing = 2 }
 

Functions

char * pcmk__op_key (const char *rsc_id, const char *op_type, guint interval_ms)
 Generate an operation key (RESOURCE_ACTION_INTERVAL) More...
 
char * pcmk__notify_key (const char *rsc_id, const char *notify_type, const char *op_type)
 
char * pcmk__transition_key (int transition_id, int action_id, int target_rc, const char *node)
 
void pcmk__filter_op_for_digest (xmlNode *param_set)
 
bool pcmk__is_fencing_action (const char *action)
 
enum pcmk__action_type pcmk__parse_action (const char *action_name)
 
const char * pcmk__action_text (enum pcmk__action_type action)
 
const char * pcmk__on_fail_text (enum pcmk__on_fail on_fail)
 

Macro Definition Documentation

◆ pcmk__clear_action_flags

#define pcmk__clear_action_flags (   action,
  flags_to_clear 
)
Value:
do { \
(action)->flags = pcmk__clear_flags_as(__func__, __LINE__, \
"Action", (action)->uuid, \
(action)->flags, \
(flags_to_clear), \
#flags_to_clear); \
} while (0)
#define LOG_TRACE
Definition: logging.h:38
const char * action
Definition: pcmk_fence.c:32
uint64_t flags
Definition: remote.c:211

Definition at line 53 of file actions_internal.h.

◆ pcmk__clear_raw_action_flags

#define pcmk__clear_raw_action_flags (   action_flags,
  action_name,
  to_clear 
)
Value:
do { \
action_flags = pcmk__clear_flags_as(__func__, __LINE__, LOG_TRACE, \
"Action", action_name, \
(action_flags), \
(to_clear), #to_clear); \
} while (0)
#define LOG_TRACE
Definition: logging.h:38

Definition at line 85 of file actions_internal.h.

◆ PCMK__OP_FMT

#define PCMK__OP_FMT   "%s_%s_%u"

printf-style format to create operation key from resource, action, interval

Definition at line 28 of file actions_internal.h.

◆ pcmk__set_action_flags

#define pcmk__set_action_flags (   action,
  flags_to_set 
)
Value:
do { \
(action)->flags = pcmk__set_flags_as(__func__, __LINE__, \
"Action", (action)->uuid, \
(action)->flags, \
(flags_to_set), \
#flags_to_set); \
} while (0)
#define LOG_TRACE
Definition: logging.h:38
const char * action
Definition: pcmk_fence.c:32
uint64_t flags
Definition: remote.c:211

Definition at line 37 of file actions_internal.h.

◆ pcmk__set_raw_action_flags

#define pcmk__set_raw_action_flags (   action_flags,
  action_name,
  to_set 
)
Value:
do { \
action_flags = pcmk__set_flags_as(__func__, __LINE__, \
LOG_TRACE, "Action", action_name, \
(action_flags), \
(to_set), #to_set); \
} while (0)
#define LOG_TRACE
Definition: logging.h:38

Definition at line 70 of file actions_internal.h.

Enumeration Type Documentation

◆ pcmk__action_flags

Enumerator
pcmk__no_action_flags 
pcmk__action_pseudo 
pcmk__action_runnable 
pcmk__action_optional 
pcmk__action_always_in_graph 
pcmk__action_attrs_evaluated 
pcmk__action_migratable 
pcmk__action_added_to_graph 
pcmk__action_migration_abort 
pcmk__action_reschedule 
pcmk__action_detect_loop 
pcmk__action_inputs_deduplicated 
pcmk__action_on_dc 

Definition at line 120 of file actions_internal.h.

◆ pcmk__action_type

Enumerator
pcmk__action_unspecified 
pcmk__action_monitor 
pcmk__action_stop 
pcmk__action_stopped 
pcmk__action_start 
pcmk__action_started 
pcmk__action_notify 
pcmk__action_notified 
pcmk__action_promote 
pcmk__action_promoted 
pcmk__action_demote 
pcmk__action_demoted 
pcmk__action_shutdown 
pcmk__action_fence 

Definition at line 94 of file actions_internal.h.

◆ pcmk__on_fail

Enumerator
pcmk__on_fail_ignore 
pcmk__on_fail_demote 
pcmk__on_fail_restart 
pcmk__on_fail_reset_remote 
pcmk__on_fail_restart_container 
pcmk__on_fail_ban 
pcmk__on_fail_block 
pcmk__on_fail_stop 
pcmk__on_fail_standby_node 
pcmk__on_fail_fence_node 

Definition at line 166 of file actions_internal.h.

◆ pcmk__requires

Enumerator
pcmk__requires_nothing 
pcmk__requires_quorum 
pcmk__requires_fencing 

Definition at line 186 of file actions_internal.h.

Function Documentation

◆ pcmk__action_text()

const char* pcmk__action_text ( enum pcmk__action_type  action)

Definition at line 34 of file actions.c.

◆ pcmk__filter_op_for_digest()

void pcmk__filter_op_for_digest ( xmlNode *  param_set)

Definition at line 299 of file digest.c.

◆ pcmk__is_fencing_action()

bool pcmk__is_fencing_action ( const char *  action)

Definition at line 581 of file actions.c.

◆ pcmk__notify_key()

char* pcmk__notify_key ( const char *  rsc_id,
const char *  notify_type,
const char *  op_type 
)

Definition at line 335 of file actions.c.

◆ pcmk__on_fail_text()

const char* pcmk__on_fail_text ( enum pcmk__on_fail  on_fail)

Definition at line 146 of file actions.c.

◆ pcmk__op_key()

char* pcmk__op_key ( const char *  rsc_id,
const char *  op_type,
guint  interval_ms 
)

Generate an operation key (RESOURCE_ACTION_INTERVAL)

Parameters
[in]rsc_idID of resource being operated on
[in]op_typeOperation name
[in]interval_msOperation interval
Returns
Newly allocated memory containing operation key as string
Note
This function asserts on errors, so it will never return NULL. The caller is responsible for freeing the result with free().

Definition at line 195 of file actions.c.

◆ pcmk__parse_action()

enum pcmk__action_type pcmk__parse_action ( const char *  action_name)

Definition at line 90 of file actions.c.

◆ pcmk__transition_key()

char* pcmk__transition_key ( int  transition_id,
int  action_id,
int  target_rc,
const char *  node 
)

Definition at line 402 of file actions.c.