pacemaker
2.1.7-0f7f88312f
Scalable High-Availability cluster resource manager
|
APIs related to actions. More...
#include <stdbool.h>
#include <strings.h>
#include <glib.h>
#include <libxml/tree.h>
#include <crm/lrmd_events.h>
#include <crm/common/nodes.h>
#include <crm/common/resources.h>
#include <crm/common/scheduler_types.h>
Go to the source code of this file.
Data Structures | |
struct | pe_action_wrapper_s |
struct | pe_action_s |
Implementation of pcmk_action_t. More... | |
Macros | |
#define | PCMK_DEFAULT_ACTION_TIMEOUT_MS 20000 |
Default timeout (in milliseconds) for non-metadata actions. More... | |
#define | PCMK_DEFAULT_METADATA_TIMEOUT_MS 30000 |
#define | PCMK_ACTION_CANCEL "cancel" |
#define | PCMK_ACTION_CLEAR_FAILCOUNT "clear_failcount" |
#define | PCMK_ACTION_CLONE_ONE_OR_MORE "clone-one-or-more" |
#define | PCMK_ACTION_DELETE "delete" |
#define | PCMK_ACTION_DEMOTE "demote" |
#define | PCMK_ACTION_DEMOTED "demoted" |
#define | PCMK_ACTION_DO_SHUTDOWN "do_shutdown" |
#define | PCMK_ACTION_LIST "list" |
#define | PCMK_ACTION_LRM_DELETE "lrm_delete" |
#define | PCMK_ACTION_LOAD_STOPPED "load_stopped" |
#define | PCMK_ACTION_MAINTENANCE_NODES "maintenance_nodes" |
#define | PCMK_ACTION_META_DATA "meta-data" |
#define | PCMK_ACTION_MIGRATE_FROM "migrate_from" |
#define | PCMK_ACTION_MIGRATE_TO "migrate_to" |
#define | PCMK_ACTION_MONITOR "monitor" |
#define | PCMK_ACTION_NOTIFIED "notified" |
#define | PCMK_ACTION_NOTIFY "notify" |
#define | PCMK_ACTION_OFF "off" |
#define | PCMK_ACTION_ON "on" |
#define | PCMK_ACTION_ONE_OR_MORE "one-or-more" |
#define | PCMK_ACTION_PROMOTE "promote" |
#define | PCMK_ACTION_PROMOTED "promoted" |
#define | PCMK_ACTION_REBOOT "reboot" |
#define | PCMK_ACTION_RELOAD "reload" |
#define | PCMK_ACTION_RELOAD_AGENT "reload-agent" |
#define | PCMK_ACTION_RUNNING "running" |
#define | PCMK_ACTION_START "start" |
#define | PCMK_ACTION_STATUS "status" |
#define | PCMK_ACTION_STONITH "stonith" |
#define | PCMK_ACTION_STOP "stop" |
#define | PCMK_ACTION_STOPPED "stopped" |
#define | PCMK_ACTION_VALIDATE_ALL "validate-all" |
Functions | |
gboolean | parse_op_key (const char *key, char **rsc_id, char **op_type, guint *interval_ms) |
gboolean | decode_transition_key (const char *key, char **uuid, int *transition_id, int *action_id, int *target_rc) |
Parse a transition key into its constituent parts. More... | |
gboolean | decode_transition_magic (const char *magic, char **uuid, int *transition_id, int *action_id, int *op_status, int *op_rc, int *target_rc) |
Parse a transition magic string into its constituent parts. More... | |
int | rsc_op_expected_rc (const lrmd_event_data_t *event) |
gboolean | did_rsc_op_fail (lrmd_event_data_t *event, int target_rc) |
bool | crm_op_needs_metadata (const char *rsc_class, const char *op) |
Check whether an operation requires resource agent meta-data. More... | |
xmlNode * | crm_create_op_xml (xmlNode *parent, const char *prefix, const char *task, const char *interval_spec, const char *timeout) |
Create a CIB XML element for an operation. More... | |
bool | pcmk_is_probe (const char *task, guint interval) |
bool | pcmk_xe_is_probe (const xmlNode *xml_op) |
bool | pcmk_xe_mask_probe_failure (const xmlNode *xml_op) |
APIs related to actions.
Definition in file actions.h.
#define PCMK_DEFAULT_ACTION_TIMEOUT_MS 20000 |
#define PCMK_DEFAULT_METADATA_TIMEOUT_MS 30000 |
enum action_fail_response |
Possible responses to a resource action failure.
Enumerator | |
---|---|
pcmk_on_fail_ignore | Act as if failure didn't happen. |
pcmk_on_fail_restart | Restart resource. |
pcmk_on_fail_ban | Ban resource from current node. |
pcmk_on_fail_block | Treat resource as unmanaged. |
pcmk_on_fail_stop | Stop resource and leave stopped. |
pcmk_on_fail_standby_node | Put resource's node in standby. |
pcmk_on_fail_fence_node | Fence resource's node. |
pcmk_on_fail_restart_container | Restart resource's container. |
pcmk_on_fail_reset_remote | Fence the remote node created by the resource if fencing is enabled, otherwise attempt to restart the resource (used internally for some remote connection failures). |
pcmk_on_fail_demote | Demote if promotable, else stop. |
action_fail_ignore |
|
action_fail_recover |
|
action_fail_migrate |
|
action_fail_block |
|
action_fail_stop |
|
action_fail_standby |
|
action_fail_fence |
|
action_fail_restart_container |
|
action_fail_reset_remote |
|
action_fail_demote |
|
enum action_tasks |
Possible actions (including some pseudo-actions)
Enumerator | |
---|---|
pcmk_action_unspecified | Unspecified or unknown action. |
pcmk_action_monitor | Monitor. |
pcmk_action_stop | Stop. |
pcmk_action_stopped | Stop completed. |
pcmk_action_start | Start. |
pcmk_action_started | Start completed. |
pcmk_action_notify | Notify. |
pcmk_action_notified | Notify completed. |
pcmk_action_promote | Promote. |
pcmk_action_promoted | Promoted. |
pcmk_action_demote | Demote. |
pcmk_action_demoted | Demoted. |
pcmk_action_shutdown | Shut down node. |
pcmk_action_fence | Fence node. |
no_action |
|
monitor_rsc |
|
stop_rsc |
|
stopped_rsc |
|
start_rsc |
|
started_rsc |
|
action_notify |
|
action_notified |
|
action_promote |
|
action_promoted |
|
action_demote |
|
action_demoted |
|
shutdown_crm |
|
stonith_node |
|
enum pe_action_flags |
Action scheduling flags.
Enumerator | |
---|---|
pcmk_no_action_flags | No action flags set (compare with equality rather than bit set) |
pcmk_action_pseudo | Whether action does not require invoking an agent. |
pcmk_action_runnable | Whether action is runnable. |
pcmk_action_optional | Whether action should not be executed. |
pcmk_action_always_in_graph | Whether action should be added to transition graph even if optional. |
pcmk_action_attrs_evaluated | Whether operation-specific instance attributes have been unpacked yet. |
pcmk_action_migratable | Whether action is allowed to be part of a live migration. |
pcmk_action_added_to_graph | Whether action has been added to transition graph. |
pcmk_action_migration_abort | Whether action is a stop to abort a dangling migration. |
pcmk_action_min_runnable | Whether action is an ordering point for minimum required instances (used to implement ordering after clones with clone-min configured, and ordered sets with require-all=false) |
pcmk_action_reschedule | Whether action is recurring monitor that must be rescheduled if active. |
pcmk_action_detect_loop | Whether action has already been processed by a recursive procedure. |
pcmk_action_inputs_deduplicated | Whether action's inputs have been de-duplicated yet. |
pcmk_action_on_dc | Whether action can be executed on DC rather than own node. |
pe_action_pseudo |
|
pe_action_runnable |
|
pe_action_optional |
|
pe_action_print_always |
|
pe_action_have_node_attrs |
|
pe_action_implied_by_stonith |
|
pe_action_migrate_runnable |
|
pe_action_dumped |
|
pe_action_processed |
|
pe_action_clear |
|
pe_action_dangle |
|
pe_action_requires_any |
|
pe_action_reschedule |
|
pe_action_tracking |
|
pe_action_dedup |
|
pe_action_dc |
|
enum pe_link_state |
Enumerator | |
---|---|
pe_link_not_dumped | |
pe_link_dumped | |
pe_link_dup |
enum pe_ordering |
xmlNode* crm_create_op_xml | ( | xmlNode * | parent, |
const char * | prefix, | ||
const char * | task, | ||
const char * | interval_spec, | ||
const char * | timeout | ||
) |
Create a CIB XML element for an operation.
[in,out] | parent | If not NULL, make new XML node a child of this |
[in] | prefix | Generate an ID using this prefix |
[in] | task | Operation task to set |
[in] | interval_spec | Operation interval to set |
[in] | timeout | If not NULL, operation timeout to set |
bool crm_op_needs_metadata | ( | const char * | rsc_class, |
const char * | op | ||
) |
Check whether an operation requires resource agent meta-data.
[in] | rsc_class | Resource agent class (or NULL to skip class check) |
[in] | op | Operation action (or NULL to skip op check) |
gboolean decode_transition_key | ( | const char * | key, |
char ** | uuid, | ||
int * | transition_id, | ||
int * | action_id, | ||
int * | target_rc | ||
) |
Parse a transition key into its constituent parts.
[in] | key | Transition key to parse (must be non-NULL) |
[out] | uuid | If non-NULL, where to store copy of parsed UUID |
[out] | transition_id | If non-NULL, where to store parsed transition ID |
[out] | action_id | If non-NULL, where to store parsed action ID |
[out] | target_rc | If non-NULL, where to stored parsed target rc |
gboolean decode_transition_magic | ( | const char * | magic, |
char ** | uuid, | ||
int * | transition_id, | ||
int * | action_id, | ||
int * | op_status, | ||
int * | op_rc, | ||
int * | target_rc | ||
) |
Parse a transition magic string into its constituent parts.
[in] | magic | Magic string to parse (must be non-NULL) |
[out] | uuid | If non-NULL, where to store copy of parsed UUID |
[out] | transition_id | If non-NULL, where to store parsed transition ID |
[out] | action_id | If non-NULL, where to store parsed action ID |
[out] | op_status | If non-NULL, where to store parsed result status |
[out] | op_rc | If non-NULL, where to store parsed actual rc |
[out] | target_rc | If non-NULL, where to stored parsed target rc |
gboolean did_rsc_op_fail | ( | lrmd_event_data_t * | event, |
int | target_rc | ||
) |
gboolean parse_op_key | ( | const char * | key, |
char ** | rsc_id, | ||
char ** | op_type, | ||
guint * | interval_ms | ||
) |
int rsc_op_expected_rc | ( | const lrmd_event_data_t * | event | ) |