pacemaker  2.1.0-7c3f660
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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
14 extern "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 
22 typedef enum {
27 
29 typedef struct crm_graph_s crm_graph_t;
30 
31 typedef struct synapse_s {
32  int id;
33  int priority;
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* */
42 } synapse_t;
43 
44 typedef struct crm_action_s {
45  int id;
46  int timeout;
47  guint interval_ms;
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 
63 } crm_action_t;
64 
65 struct te_timer_s {
66  int source_id;
67  int timeout;
69 };
70 
71 /* order matters here */
77 };
78 
79 struct crm_graph_s {
80  int id;
81  char *source;
83 
84  gboolean complete;
85  const char *abort_reason;
87 
90 
94 
95  int fired;
96  int pending;
97  int skipped;
98  int completed;
100 
101  GList *synapses; /* synapse_t* */
102 
104 };
105 
106 typedef 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 
116  transition_pending, /* active but no actions performed this time */
122 };
123 
124 void set_default_graph_functions(void);
126 crm_graph_t *unpack_graph(xmlNode * xml_graph, const char *reference);
127 int run_graph(crm_graph_t * graph);
128 gboolean update_graph(crm_graph_t * graph, crm_action_t * action);
129 void destroy_graph(crm_graph_t * graph);
130 const char *transition_status(enum transition_status state);
131 void print_graph(unsigned int log_level, crm_graph_t * graph);
132 void print_action(int log_level, const char *prefix, crm_action_t * action);
133 bool update_abort_priority(crm_graph_t * graph, int priority,
134  enum transition_action action, const char *abort_reason);
135 const char *actiontype2text(action_type_e type);
136 lrmd_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
gboolean(* pseudo)(crm_graph_t *graph, crm_action_t *action)
gboolean sent_update
gboolean confirmed
A dumping ground.
bool update_abort_priority(crm_graph_t *graph, int priority, enum transition_action action, const char *abort_reason)
action_type_e type
enum transition_action completion_action
struct synapse_s synapse_t
void print_graph(unsigned int log_level, crm_graph_t *graph)
struct crm_graph_functions_s crm_graph_functions_t
transition_status
gboolean can_fail
gboolean(* rsc)(crm_graph_t *graph, crm_action_t *action)
crm_graph_t * unpack_graph(xmlNode *xml_graph, const char *reference)
enum crm_ais_msg_types type
Definition: cpg.c:48
gboolean(* allowed)(crm_graph_t *graph, crm_action_t *action)
GHashTable * params
crm_action_timer_t * timer
gboolean ready
const char * action
Definition: pcmk_fence.c:30
void print_action(int log_level, const char *prefix, crm_action_t *action)
int rc
Definition: pcmk_fence.c:35
GList * inputs
void set_default_graph_functions(void)
GList * actions
gboolean executed
Wrappers for and extensions to libxml2.
gboolean(* crmd)(crm_graph_t *graph, crm_action_t *action)
gboolean update_graph(crm_graph_t *graph, crm_action_t *action)
const char * actiontype2text(action_type_e type)
gboolean complete
void destroy_graph(crm_graph_t *graph)
gboolean failed
guint stonith_timeout
lrmd_event_data_t * convert_graph_action(xmlNode *resource, crm_action_t *action, int status, int rc)
struct crm_action_s crm_action_t
gboolean(* stonith)(crm_graph_t *graph, crm_action_t *action)
transition_action
int run_graph(crm_graph_t *graph)
gboolean confirmed
action_type_e
crm_action_t * action
void set_graph_functions(crm_graph_functions_t *fns)
gboolean executed
synapse_t * synapse
const char * abort_reason