pacemaker 2.1.1-77db578727
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
pcmki_transition.h
Go to the documentation of this file.
1/*
2 * Copyright 2004-2021 the Pacemaker project contributors
3 *
4 * The version control history for this file may have further details.
5 *
6 * This source code is licensed under the GNU Lesser General Public License
7 * version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8 */
9
10#ifndef CRM_TRANSITION__H
11# define CRM_TRANSITION__H
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17#include <glib.h>
18#include <crm/crm.h>
19#include <crm/msg_xml.h>
20#include <crm/common/xml.h>
21
27
29typedef struct crm_graph_s crm_graph_t;
30
31typedef struct synapse_s {
32 int id;
34
35 gboolean ready;
36 gboolean failed;
37 gboolean executed;
38 gboolean confirmed;
39
40 GList *actions; /* crm_action_t* */
41 GList *inputs; /* crm_action_t* */
43
44typedef struct crm_action_s {
45 int id;
48 GHashTable *params;
50
53
54 gboolean sent_update; /* sent to the CIB */
55 gboolean executed; /* sent to the CRM */
56 gboolean confirmed;
57
58 gboolean failed;
59 gboolean can_fail;
60
61 xmlNode *xml;
62
64
70
71/* order matters here */
78
80 int id;
81 char *source;
83
84 gboolean complete;
85 const char *abort_reason;
87
90
94
95 int fired;
100
101 GList *synapses; /* synapse_t* */
102
104};
105
106typedef struct crm_graph_functions_s {
107 gboolean(*pseudo) (crm_graph_t * graph, crm_action_t * action);
108 gboolean(*rsc) (crm_graph_t * graph, crm_action_t * action);
109 gboolean(*crmd) (crm_graph_t * graph, crm_action_t * action);
110 gboolean(*stonith) (crm_graph_t * graph, crm_action_t * action);
111 gboolean(*allowed) (crm_graph_t * graph, crm_action_t * action);
113
123
126crm_graph_t *unpack_graph(xmlNode * xml_graph, const char *reference);
127int run_graph(crm_graph_t * graph);
128gboolean update_graph(crm_graph_t * graph, crm_action_t * action);
129void destroy_graph(crm_graph_t * graph);
130const char *transition_status(enum transition_status state);
131void print_graph(unsigned int log_level, crm_graph_t * graph);
132void print_action(int log_level, const char *prefix, crm_action_t * action);
133bool update_abort_priority(crm_graph_t * graph, int priority,
134 enum transition_action action, const char *abort_reason);
136lrmd_event_data_t *convert_graph_action(xmlNode * resource, crm_action_t * action, int status,
137 int rc);
138
139#ifdef __cplusplus
140}
141#endif
142
143#endif
enum crm_ais_msg_types type
Definition cpg.c:3
A dumping ground.
const char * action
Definition pcmk_fence.c:30
int rc
Definition pcmk_fence.c:35
bool update_abort_priority(crm_graph_t *graph, int priority, enum transition_action action, const char *abort_reason)
void set_graph_functions(crm_graph_functions_t *fns)
transition_status
@ transition_action_failed
@ transition_active
@ transition_failed
@ transition_complete
@ transition_terminated
@ transition_pending
@ transition_stopped
gboolean update_graph(crm_graph_t *graph, crm_action_t *action)
struct synapse_s synapse_t
void set_default_graph_functions(void)
void print_graph(unsigned int log_level, crm_graph_t *graph)
transition_action
@ tg_shutdown
@ tg_done
@ tg_stop
@ tg_restart
lrmd_event_data_t * convert_graph_action(xmlNode *resource, crm_action_t *action, int status, int rc)
int run_graph(crm_graph_t *graph)
crm_graph_t * unpack_graph(xmlNode *xml_graph, const char *reference)
const char * actiontype2text(action_type_e type)
void destroy_graph(crm_graph_t *graph)
void print_action(int log_level, const char *prefix, crm_action_t *action)
action_type_e
@ action_type_rsc
@ action_type_pseudo
@ action_type_crm
struct crm_action_s crm_action_t
struct crm_graph_functions_s crm_graph_functions_t
synapse_t * synapse
action_type_e type
GHashTable * params
crm_action_timer_t * timer
gboolean sent_update
gboolean(* stonith)(crm_graph_t *graph, crm_action_t *action)
gboolean(* pseudo)(crm_graph_t *graph, crm_action_t *action)
gboolean(* crmd)(crm_graph_t *graph, crm_action_t *action)
gboolean(* rsc)(crm_graph_t *graph, crm_action_t *action)
gboolean(* allowed)(crm_graph_t *graph, crm_action_t *action)
enum transition_action completion_action
const char * abort_reason
gboolean complete
gboolean executed
gboolean ready
gboolean confirmed
GList * actions
gboolean failed
crm_action_t * action
Wrappers for and extensions to libxml2.