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/probes.h>
Go to the source code of this file.
|
| 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...
|
| |
APIs related to actions.
Definition in file actions.h.
◆ PCMK_ACTION_CANCEL
| #define PCMK_ACTION_CANCEL "cancel" |
◆ PCMK_ACTION_CLEAR_FAILCOUNT
| #define PCMK_ACTION_CLEAR_FAILCOUNT "clear_failcount" |
◆ PCMK_ACTION_CLONE_ONE_OR_MORE
| #define PCMK_ACTION_CLONE_ONE_OR_MORE "clone-one-or-more" |
◆ PCMK_ACTION_DELETE
| #define PCMK_ACTION_DELETE "delete" |
◆ PCMK_ACTION_DEMOTE
| #define PCMK_ACTION_DEMOTE "demote" |
◆ PCMK_ACTION_DEMOTED
| #define PCMK_ACTION_DEMOTED "demoted" |
◆ PCMK_ACTION_DO_SHUTDOWN
| #define PCMK_ACTION_DO_SHUTDOWN "do_shutdown" |
◆ PCMK_ACTION_LIST
| #define PCMK_ACTION_LIST "list" |
◆ PCMK_ACTION_LOAD_STOPPED
| #define PCMK_ACTION_LOAD_STOPPED "load_stopped" |
◆ PCMK_ACTION_LRM_DELETE
| #define PCMK_ACTION_LRM_DELETE "lrm_delete" |
◆ PCMK_ACTION_MAINTENANCE_NODES
| #define PCMK_ACTION_MAINTENANCE_NODES "maintenance_nodes" |
◆ PCMK_ACTION_META_DATA
| #define PCMK_ACTION_META_DATA "meta-data" |
◆ PCMK_ACTION_METADATA
| #define PCMK_ACTION_METADATA "metadata" |
◆ PCMK_ACTION_MIGRATE_FROM
| #define PCMK_ACTION_MIGRATE_FROM "migrate_from" |
◆ PCMK_ACTION_MIGRATE_TO
| #define PCMK_ACTION_MIGRATE_TO "migrate_to" |
◆ PCMK_ACTION_MONITOR
| #define PCMK_ACTION_MONITOR "monitor" |
◆ PCMK_ACTION_NOTIFIED
| #define PCMK_ACTION_NOTIFIED "notified" |
◆ PCMK_ACTION_NOTIFY
| #define PCMK_ACTION_NOTIFY "notify" |
◆ PCMK_ACTION_OFF
| #define PCMK_ACTION_OFF "off" |
◆ PCMK_ACTION_ON
| #define PCMK_ACTION_ON "on" |
◆ PCMK_ACTION_ONE_OR_MORE
| #define PCMK_ACTION_ONE_OR_MORE "one-or-more" |
◆ PCMK_ACTION_PROMOTE
| #define PCMK_ACTION_PROMOTE "promote" |
◆ PCMK_ACTION_PROMOTED
| #define PCMK_ACTION_PROMOTED "promoted" |
◆ PCMK_ACTION_REBOOT
| #define PCMK_ACTION_REBOOT "reboot" |
◆ PCMK_ACTION_RELOAD
| #define PCMK_ACTION_RELOAD "reload" |
◆ PCMK_ACTION_RELOAD_AGENT
| #define PCMK_ACTION_RELOAD_AGENT "reload-agent" |
◆ PCMK_ACTION_RUNNING
| #define PCMK_ACTION_RUNNING "running" |
◆ PCMK_ACTION_START
| #define PCMK_ACTION_START "start" |
◆ PCMK_ACTION_STATUS
| #define PCMK_ACTION_STATUS "status" |
◆ PCMK_ACTION_STONITH
| #define PCMK_ACTION_STONITH "stonith" |
◆ PCMK_ACTION_STOP
| #define PCMK_ACTION_STOP "stop" |
◆ PCMK_ACTION_STOPPED
| #define PCMK_ACTION_STOPPED "stopped" |
◆ PCMK_ACTION_VALIDATE_ALL
| #define PCMK_ACTION_VALIDATE_ALL "validate-all" |
◆ PCMK_DEFAULT_ACTION_TIMEOUT_MS
| #define PCMK_DEFAULT_ACTION_TIMEOUT_MS 20000 |
Default timeout (in milliseconds) for non-metadata actions.
Definition at line 33 of file actions.h.
◆ crm_create_op_xml()
| 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.
- Parameters
-
| [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 |
- Returns
- New XML object on success, NULL otherwise
Definition at line 519 of file actions.c.
◆ crm_op_needs_metadata()
| bool crm_op_needs_metadata |
( |
const char * |
rsc_class, |
|
|
const char * |
op |
|
) |
| |
Check whether an operation requires resource agent meta-data.
- Parameters
-
| [in] | rsc_class | Resource agent class (or NULL to skip class check) |
| [in] | op | Operation action (or NULL to skip op check) |
- Returns
- true if operation needs meta-data, false otherwise
- Note
- At least one of rsc_class and op must be specified.
Definition at line 546 of file actions.c.
◆ decode_transition_key()
| 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.
- Parameters
-
| [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 |
- Returns
- TRUE if key was valid, FALSE otherwise
- Note
- If uuid is supplied and this returns TRUE, the caller is responsible for freeing the memory for *uuid using free().
Definition at line 424 of file actions.c.
◆ decode_transition_magic()
| 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.
- Parameters
-
| [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 |
- Returns
- TRUE if key was valid, FALSE otherwise
- Note
- If uuid is supplied and this returns TRUE, the caller is responsible for freeing the memory for *uuid using free().
Definition at line 361 of file actions.c.
◆ did_rsc_op_fail()
◆ parse_op_key()
| gboolean parse_op_key |
( |
const char * |
key, |
|
|
char ** |
rsc_id, |
|
|
char ** |
op_type, |
|
|
guint * |
interval_ms |
|
) |
| |
◆ rsc_op_expected_rc()