pacemaker  1.1.18-7fdfbbe
Scalable High-Availability cluster resource manager
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
transition.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2004 Andrew Beekhof <andrew@beekhof.net>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This software is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 #ifndef CRM_TRANSITION__H
19 # define CRM_TRANSITION__H
20 
21 #include <crm/crm.h>
22 #include <crm/msg_xml.h>
23 #include <crm/common/xml.h>
24 
25 typedef enum {
30 
32 typedef struct crm_graph_s crm_graph_t;
33 
34 typedef struct synapse_s {
35  int id;
36  int priority;
37 
38  gboolean ready;
39  gboolean failed;
40  gboolean executed;
41  gboolean confirmed;
42 
43  GListPtr actions; /* crm_action_t* */
44  GListPtr inputs; /* crm_action_t* */
45 } synapse_t;
46 
47 typedef struct crm_action_s {
48  int id;
49  int timeout;
50  int interval;
51  GHashTable *params;
53 
56 
57  gboolean sent_update; /* sent to the CIB */
58  gboolean executed; /* sent to the CRM */
59  gboolean confirmed;
60 
61  gboolean failed;
62  gboolean can_fail;
63 
64  xmlNode *xml;
65 
66 } crm_action_t;
67 
68 /* @COMPAT: This enum has deprecated. It has apparently never been used in a
69  * Pacemaker release, but it is kept for API backward compatibility.
70  */
75 };
76 
77 struct te_timer_s {
78  int source_id;
79  int timeout;
80  enum timer_reason reason; /* @COMPAT: unused, API backward compatibility */
82 };
83 
84 /* order matters here */
90 };
91 
92 struct crm_graph_s {
93  int id;
94  char *source;
96 
97  gboolean complete;
98  const char *abort_reason;
100 
103 
108 
109  int fired;
110  int pending;
111  int skipped;
114 
115  GListPtr synapses; /* synpase_t* */
116 
118 };
119 
120 typedef struct crm_graph_functions_s {
121  gboolean(*pseudo) (crm_graph_t * graph, crm_action_t * action);
122  gboolean(*rsc) (crm_graph_t * graph, crm_action_t * action);
123  gboolean(*crmd) (crm_graph_t * graph, crm_action_t * action);
124  gboolean(*stonith) (crm_graph_t * graph, crm_action_t * action);
125  gboolean(*allowed) (crm_graph_t * graph, crm_action_t * action);
127 
130  transition_pending, /* active but no actions performed this time */
136 };
137 
138 void set_default_graph_functions(void);
140 crm_graph_t *unpack_graph(xmlNode * xml_graph, const char *reference);
141 int run_graph(crm_graph_t * graph);
142 gboolean update_graph(crm_graph_t * graph, crm_action_t * action);
143 void destroy_graph(crm_graph_t * graph);
144 const char *transition_status(enum transition_status state);
145 void print_graph(unsigned int log_level, crm_graph_t * graph);
146 void print_action(int log_level, const char *prefix, crm_action_t * action);
147 bool update_abort_priority(crm_graph_t * graph, int priority,
148  enum transition_action action, const char *abort_reason);
149 const char *actiontype2text(action_type_e type);
150 lrmd_event_data_t *convert_graph_action(xmlNode * resource, crm_action_t * action, int status,
151  int rc);
152 
153 #endif
gboolean(* pseudo)(crm_graph_t *graph, crm_action_t *action)
Definition: transition.h:121
GListPtr actions
Definition: transition.h:43
gboolean sent_update
Definition: transition.h:57
gboolean confirmed
Definition: transition.h:41
A dumping ground.
action_type_e type
Definition: transition.h:52
bool update_abort_priority(crm_graph_t *graph, int priority, enum transition_action action, const char *abort_reason)
Definition: utils.c:263
enum transition_action completion_action
Definition: transition.h:99
xmlNode * xml
Definition: transition.h:64
void destroy_graph(crm_graph_t *graph)
Definition: unpack.c:280
void print_action(int log_level, const char *prefix, crm_action_t *action)
Definition: utils.c:217
lrmd_event_data_t * convert_graph_action(xmlNode *resource, crm_action_t *action, int status, int rc)
Definition: unpack.c:297
struct synapse_s synapse_t
gboolean can_fail
Definition: transition.h:62
gboolean(* rsc)(crm_graph_t *graph, crm_action_t *action)
Definition: transition.h:122
const char * actiontype2text(action_type_e type)
Definition: utils.c:105
void set_graph_functions(crm_graph_functions_t *fns)
Definition: utils.c:70
int num_synapses
Definition: transition.h:102
transition_action
Definition: transition.h:85
gboolean(* allowed)(crm_graph_t *graph, crm_action_t *action)
Definition: transition.h:125
GHashTable * params
Definition: transition.h:51
crm_action_timer_t * timer
Definition: transition.h:54
gboolean ready
Definition: transition.h:38
int transition_timeout
Definition: transition.h:107
int incomplete
Definition: transition.h:113
int priority
Definition: transition.h:36
void set_default_graph_functions(void)
Definition: utils.c:64
void print_graph(unsigned int log_level, crm_graph_t *graph)
Definition: utils.c:223
gboolean executed
Definition: transition.h:58
Wrappers for and extensions to libxml2.
timer_reason
Definition: transition.h:71
gboolean(* crmd)(crm_graph_t *graph, crm_action_t *action)
Definition: transition.h:123
transition_status
Definition: transition.h:128
GListPtr synapses
Definition: transition.h:115
gboolean complete
Definition: transition.h:97
gboolean update_graph(crm_graph_t *graph, crm_action_t *action)
Definition: graph.c:102
struct crm_action_s crm_action_t
int stonith_timeout
Definition: transition.h:106
enum timer_reason reason
Definition: transition.h:80
int batch_limit
Definition: transition.h:104
GListPtr inputs
Definition: transition.h:44
gboolean failed
Definition: transition.h:39
crm_graph_t * unpack_graph(xmlNode *xml_graph, const char *reference)
Definition: unpack.c:172
char * source
Definition: transition.h:94
int network_delay
Definition: transition.h:105
int num_actions
Definition: transition.h:101
gboolean failed
Definition: transition.h:61
int migration_limit
Definition: transition.h:117
gboolean(* stonith)(crm_graph_t *graph, crm_action_t *action)
Definition: transition.h:124
int run_graph(crm_graph_t *graph)
Definition: graph.c:247
int timeout
Definition: transition.h:79
int abort_priority
Definition: transition.h:95
struct crm_graph_functions_s crm_graph_functions_t
int source_id
Definition: transition.h:78
gboolean confirmed
Definition: transition.h:59
crm_action_t * action
Definition: transition.h:81
action_type_e
Definition: transition.h:25
GList * GListPtr
Definition: crm.h:218
gboolean executed
Definition: transition.h:40
synapse_t * synapse
Definition: transition.h:55
const char * abort_reason
Definition: transition.h:98
enum crm_ais_msg_types type
Definition: internal.h:51