pacemaker  2.1.4-dc6eb4362
Scalable High-Availability cluster resource manager
pacemaker.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019-2022 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 PCMK__PACEMAKER__H
11 # define PCMK__PACEMAKER__H
12 
13 # include <glib.h>
14 # include <libxml/tree.h>
15 # include <crm/cib/cib_types.h>
16 # include <crm/pengine/pe_types.h>
17 
18 # include <crm/stonith-ng.h>
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
38  pcmk_sim_process = 1 << 2,
43  pcmk_sim_verbose = 1 << 7,
44 };
45 
50 typedef struct {
52  GList *node_up;
54  GList *node_down;
56  GList *node_fail;
61  GList *op_inject;
66  GList *op_fail;
68  GList *ticket_grant;
70  GList *ticket_revoke;
76  char *watchdog;
78  char *quorum;
80 
90 int pcmk_controller_status(xmlNodePtr *xml, char *dest_node, unsigned int message_timeout_ms);
91 
100 int pcmk_designated_controller(xmlNodePtr *xml, unsigned int message_timeout_ms);
101 
107 void pcmk_free_injections(pcmk_injections_t *injections);
108 
118 int pcmk_pacemakerd_status(xmlNodePtr *xml, char *ipc_name, unsigned int message_timeout_ms);
119 
131 int pcmk_resource_digests(xmlNodePtr *xml, pe_resource_t *rsc,
132  pe_node_t *node, GHashTable *overrides,
134 
164 int pcmk_simulate(xmlNodePtr *xml, pe_working_set_t *data_set,
165  pcmk_injections_t *injections, unsigned int flags,
166  unsigned int section_opts, char *use_date, char *input_file,
167  char *graph_file, char *dot_file);
168 
177 int pcmk_list_nodes(xmlNodePtr *xml, char *node_types);
178 
187 int pcmk_status(xmlNodePtr *xml);
188 
189 #ifdef BUILD_PUBLIC_LIBPACEMAKER
190 
212 int pcmk_request_fencing(stonith_t *st, const char *target, const char *action,
213  const char *name, unsigned int timeout,
214  unsigned int tolerance, int delay, char **reason);
215 
233 int pcmk_fence_history(xmlNodePtr *xml, stonith_t *st, char *target,
234  unsigned int timeout, bool quiet, int verbose,
235  bool broadcast, bool cleanup);
236 
249 int pcmk_fence_installed(xmlNodePtr *xml, stonith_t *st, unsigned int timeout);
250 
263 int pcmk_fence_last(xmlNodePtr *xml, const char *target, bool as_nodeid);
264 
278 int pcmk_fence_list_targets(xmlNodePtr *xml, stonith_t *st,
279  const char *device_id, unsigned int timeout);
280 
294 int pcmk_fence_metadata(xmlNodePtr *xml, stonith_t *st, char *agent,
295  unsigned int timeout);
296 
311 int pcmk_fence_registered(xmlNodePtr *xml, stonith_t *st, char *target,
312  unsigned int timeout);
313 
329 int pcmk_fence_register_level(stonith_t *st, char *target, int fence_level,
330  stonith_key_value_t *devices);
331 
346 int pcmk_fence_unregister_level(stonith_t *st, char *target, int fence_level);
347 
363 int pcmk_fence_validate(xmlNodePtr *xml, stonith_t *st, const char *agent,
364  const char *id, stonith_key_value_t *params,
365  unsigned int timeout);
366 #endif
367 
368 #ifdef __cplusplus
369 }
370 #endif
371 
372 #endif
int pcmk_simulate(xmlNodePtr *xml, pe_working_set_t *data_set, pcmk_injections_t *injections, unsigned int flags, unsigned int section_opts, char *use_date, char *input_file, char *graph_file, char *dot_file)
Simulate a cluster&#39;s response to events.
GList * op_inject
Definition: pacemaker.h:61
const char * name
Definition: cib.c:24
GList * ticket_activate
Definition: pacemaker.h:74
int pcmk_pacemakerd_status(xmlNodePtr *xml, char *ipc_name, unsigned int message_timeout_ms)
Get pacemakerd status.
Data types for Cluster Information Base access.
GList * node_up
Definition: pacemaker.h:52
int pcmk_designated_controller(xmlNodePtr *xml, unsigned int message_timeout_ms)
Get designated controller.
int pcmk_status(xmlNodePtr *xml)
Output the current status of the cluster, formatted in the same way that crm_mon --output-as=xml woul...
Definition: pcmk_status.c:206
GList * ticket_grant
Definition: pacemaker.h:68
const char * action
Definition: pcmk_fence.c:29
int pcmk_resource_digests(xmlNodePtr *xml, pe_resource_t *rsc, pe_node_t *node, GHashTable *overrides, pe_working_set_t *data_set)
Calculate and output resource operation digests.
stonith_t * st
Definition: pcmk_fence.c:27
unsigned int tolerance
Definition: pcmk_fence.c:32
GList * ticket_standby
Definition: pacemaker.h:72
pe_working_set_t * data_set
int pcmk_list_nodes(xmlNodePtr *xml, char *node_types)
Get nodes list.
void pcmk_free_injections(pcmk_injections_t *injections)
Free a :pcmk_injections_t structure.
const char * target
Definition: pcmk_fence.c:28
int pcmk_controller_status(xmlNodePtr *xml, char *dest_node, unsigned int message_timeout_ms)
Get controller status.
GList * ticket_revoke
Definition: pacemaker.h:70
int delay
Definition: pcmk_fence.c:33
Synthetic cluster events that can be injected into the cluster for running simulations.
Definition: pacemaker.h:50
Fencing aka. STONITH.
GList * node_fail
Definition: pacemaker.h:56
GList * op_fail
Definition: pacemaker.h:66
Data types for cluster status.
pcmk_sim_flags
Modify operation of running a cluster simulation.
Definition: pacemaker.h:34
unsigned int timeout
Definition: pcmk_fence.c:31
GList * node_down
Definition: pacemaker.h:54
uint64_t flags
Definition: remote.c:149