10#ifndef PCMK__CRM_COMMON_ACTIONS__H
11#define PCMK__CRM_COMMON_ACTIONS__H
16#include <libxml/tree.h>
21#include <libxml/tree.h>
38#define PCMK_DEFAULT_ACTION_TIMEOUT_MS 20000
42#define PCMK_DEFAULT_METADATA_TIMEOUT_MS 30000
45#define PCMK_ACTION_CANCEL "cancel"
46#define PCMK_ACTION_CLEAR_FAILCOUNT "clear_failcount"
47#define PCMK_ACTION_CLONE_ONE_OR_MORE "clone-one-or-more"
48#define PCMK_ACTION_DELETE "delete"
49#define PCMK_ACTION_DEMOTE "demote"
50#define PCMK_ACTION_DEMOTED "demoted"
51#define PCMK_ACTION_DO_SHUTDOWN "do_shutdown"
52#define PCMK_ACTION_LIST "list"
53#define PCMK_ACTION_LRM_DELETE "lrm_delete"
54#define PCMK_ACTION_LOAD_STOPPED "load_stopped"
55#define PCMK_ACTION_MAINTENANCE_NODES "maintenance_nodes"
56#define PCMK_ACTION_META_DATA "meta-data"
57#define PCMK_ACTION_MIGRATE_FROM "migrate_from"
58#define PCMK_ACTION_MIGRATE_TO "migrate_to"
59#define PCMK_ACTION_MONITOR "monitor"
60#define PCMK_ACTION_NOTIFIED "notified"
61#define PCMK_ACTION_NOTIFY "notify"
62#define PCMK_ACTION_OFF "off"
63#define PCMK_ACTION_ON "on"
64#define PCMK_ACTION_ONE_OR_MORE "one-or-more"
65#define PCMK_ACTION_PROMOTE "promote"
66#define PCMK_ACTION_PROMOTED "promoted"
67#define PCMK_ACTION_REBOOT "reboot"
68#define PCMK_ACTION_RELOAD "reload"
69#define PCMK_ACTION_RELOAD_AGENT "reload-agent"
70#define PCMK_ACTION_RUNNING "running"
71#define PCMK_ACTION_START "start"
72#define PCMK_ACTION_STATUS "status"
73#define PCMK_ACTION_STONITH "stonith"
74#define PCMK_ACTION_STOP "stop"
75#define PCMK_ACTION_STOPPED "stopped"
76#define PCMK_ACTION_VALIDATE_ALL "validate-all"
103#if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
199#if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
341#if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
348#if !defined(PCMK_ALLOW_DEPRECATED) || (PCMK_ALLOW_DEPRECATED == 1)
441gboolean
parse_op_key(
const char *key,
char **rsc_id,
char **op_type,
444 int *action_id,
int *target_rc);
446 int *transition_id,
int *action_id,
447 int *
op_status,
int *op_rc,
int *target_rc);
456 const char *task,
const char *interval_spec,
bool pcmk_xe_mask_probe_failure(const xmlNode *xml_op)
gboolean parse_op_key(const char *key, char **rsc_id, char **op_type, guint *interval_ms)
gboolean did_rsc_op_fail(lrmd_event_data_t *event, int target_rc)
bool pcmk_is_probe(const char *task, guint interval)
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.
@ pe_order_implies_first_printed
@ pe_order_implies_first_master
@ pe_order_anti_colocation
@ pe_order_then_cancels_first
@ pe_order_serialize_only
@ pe_order_implies_then_on_node
@ pe_order_implies_first_migratable
@ pe_order_implies_then_printed
@ pe_order_promoted_implies_first
@ pe_order_apply_first_non_migratable
action_fail_response
Possible responses to a resource action failure.
@ pcmk_on_fail_ban
Ban resource from current node.
@ pcmk_on_fail_fence_node
Fence resource's node.
@ pcmk_on_fail_ignore
Act as if failure didn't happen.
@ action_fail_reset_remote
@ pcmk_on_fail_restart_container
Restart resource's container.
@ pcmk_on_fail_demote
Demote if promotable, else stop.
@ pcmk_on_fail_standby_node
Put resource's node in standby.
@ pcmk_on_fail_block
Treat resource as unmanaged.
@ action_fail_restart_container
@ pcmk_on_fail_reset_remote
@ pcmk_on_fail_stop
Stop resource and leave stopped.
@ pcmk_on_fail_restart
Restart resource.
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.
pe_action_flags
Action scheduling flags.
@ pcmk_action_detect_loop
Whether action has already been processed by a recursive procedure.
@ pcmk_action_runnable
Whether action is runnable.
@ pcmk_action_reschedule
Whether action is recurring monitor that must be rescheduled if active.
@ 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_pseudo
Whether action does not require invoking an agent.
@ pe_action_implied_by_stonith
@ pcmk_action_attrs_evaluated
Whether operation-specific instance attributes have been unpacked yet.
@ pcmk_action_optional
Whether action should not be executed.
@ pcmk_action_migration_abort
Whether action is a stop to abort a dangling migration.
@ pcmk_action_on_dc
Whether action can be executed on DC rather than own node.
@ pe_action_have_node_attrs
@ pcmk_action_min_runnable
@ pcmk_no_action_flags
No action flags set (compare with equality rather than bit set)
@ pcmk_action_always_in_graph
Whether action should be added to transition graph even if optional.
@ pcmk_action_inputs_deduplicated
Whether action's inputs have been de-duplicated yet.
@ pe_action_migrate_runnable
action_tasks
Possible actions (including some pseudo-actions)
@ pcmk_action_start
Start.
@ pcmk_action_fence
Fence node.
@ pcmk_action_demote
Demote.
@ pcmk_action_stopped
Stop completed.
@ pcmk_action_promote
Promote.
@ pcmk_action_started
Start completed.
@ pcmk_action_notified
Notify completed.
@ pcmk_action_demoted
Demoted.
@ pcmk_action_shutdown
Shut down node.
@ pcmk_action_unspecified
Unspecified or unknown action.
@ pcmk_action_promoted
Promoted.
@ pcmk_action_notify
Notify.
@ pcmk_action_monitor
Monitor.
int rsc_op_expected_rc(const lrmd_event_data_t *event)
bool crm_op_needs_metadata(const char *rsc_class, const char *op)
Check whether an operation requires resource agent meta-data.
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.
bool pcmk_xe_is_probe(const xmlNode *xml_op)
#define PCMK_ALLOW_DEPRECATED
Allow use of deprecated Pacemaker APIs.
Resource agent executor events.
Scheduler API for resources.
rsc_start_requirement
What resource needs before it can be recovered from a failed node.
Type aliases needed to define scheduler objects.
Implementation of pcmk_action_t.
pcmk_node_t * node
Node to execute action on, if any.
char * reason
Readable description of why action is needed.
int runnable_before
For Pacemaker use only.
void * action_details
For Pacemaker use only.
enum rsc_role_e fail_role
Resource role if action fails.
enum rsc_start_requirement needs
Prerequisite for recovery.
GList * actions_after
For Pacemaker use only.
GHashTable * meta
Meta-attributes relevant to action.
int id
Counter to identify action.
enum action_fail_response on_fail
Response to failure.
char * cancel_task
If task is "cancel", the action being cancelled.
enum pe_action_flags flags
Group of enum pe_action_flags.
int required_runnable_before
xmlNode * op_entry
Action XML configuration, if any.
pcmk_resource_t * rsc
Resource to apply action to, if any.
GHashTable * extra
Action-specific instance attributes.
GList * actions_before
For Pacemaker use only.
Implementation of pcmk_node_t.
Implementation of pcmk_resource_t.