pacemaker  2.0.5-ba59be712
Scalable High-Availability cluster resource manager
ipc_controld.h
Go to the documentation of this file.
1 /*
2  * Copyright 2020 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__IPC_CONTROLD__H
11 # define PCMK__IPC_CONTROLD__H
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
24 #include <stdbool.h> // bool
25 #include <glib.h> // GList
26 #include <libxml/tree.h> // xmlNode
27 #include <crm/common/ipc.h> // pcmk_ipc_api_t
28 
37 };
38 
39 // Node information passed with pcmk_controld_reply_nodes
40 typedef struct {
41  uint32_t id;
42  const char *uname;
43  const char *state;
45 
57 typedef struct {
58  enum pcmk_controld_api_reply reply_type;
59  const char *feature_set;
60  const char *host_from;
61 
62  union {
63  // pcmk_controld_reply_info
64  struct {
66  bool is_remote;
67  int id;
68  const char *uuid;
69  const char *uname;
70  const char *state;
71  } node_info;
72 
73  // pcmk_controld_reply_resource
74  struct {
75  xmlNode *node_state; //<! Resource operation history XML
76  } resource;
77 
78  // pcmk_controld_reply_ping
79  struct {
80  const char *sys_from;
81  const char *fsa_state;
82  const char *result;
83  } ping;
84 
85  // pcmk_controld_reply_nodes
86  GList *nodes; // list of pcmk_controld_api_node_t *
87  } data;
89 
90 int pcmk_controld_api_reprobe(pcmk_ipc_api_t *api, const char *target_node,
91  const char *router_node);
92 int pcmk_controld_api_node_info(pcmk_ipc_api_t *api, uint32_t nodeid);
93 int pcmk_controld_api_fail(pcmk_ipc_api_t *api, const char *target_node,
94  const char *router_node, const char *rsc_id,
95  const char *rsc_long_id, const char *standard,
96  const char *provider, const char *type);
97 int pcmk_controld_api_refresh(pcmk_ipc_api_t *api, const char *target_node,
98  const char *router_node, const char *rsc_id,
99  const char *rsc_long_id, const char *standard,
100  const char *provider, const char *type,
101  bool cib_only);
102 int pcmk_controld_api_ping(pcmk_ipc_api_t *api, const char *node_name);
104 int pcmk_controld_api_shutdown(pcmk_ipc_api_t *api, const char *node_name);
107 
108 #ifdef __cplusplus
109 }
110 #endif
111 
112 #endif // PCMK__IPC_CONTROLD__H
unsigned int pcmk_controld_api_replies_expected(pcmk_ipc_api_t *api)
Get the number of IPC replies currently expected from the controller.
Definition: ipc_controld.c:619
const char * host_from
Name of node that sent reply.
Definition: ipc_controld.h:60
int pcmk_controld_api_refresh(pcmk_ipc_api_t *api, const char *target_node, const char *router_node, const char *rsc_id, const char *rsc_long_id, const char *standard, const char *provider, const char *type, bool cib_only)
Ask the controller to refresh a resource.
Definition: ipc_controld.c:597
int pcmk_controld_api_ping(pcmk_ipc_api_t *api, const char *node_name)
Ask the controller for status.
Definition: ipc_controld.c:396
int pcmk_controld_api_fail(pcmk_ipc_api_t *api, const char *target_node, const char *router_node, const char *rsc_id, const char *rsc_long_id, const char *standard, const char *provider, const char *type)
Ask the controller to fail a resource.
Definition: ipc_controld.c:566
int pcmk_controld_api_start_election(pcmk_ipc_api_t *api)
Definition: ipc_controld.c:474
const char * feature_set
CRM feature set advertised by controller.
Definition: ipc_controld.h:59
char data[0]
Definition: internal.h:90
IPC interface to Pacemaker daemons.
int pcmk_controld_api_reprobe(pcmk_ipc_api_t *api, const char *target_node, const char *router_node)
Send a reprobe controller operation.
Definition: ipc_controld.c:333
int pcmk_controld_api_list_nodes(pcmk_ipc_api_t *api)
Ask the controller for cluster information.
Definition: ipc_controld.c:419
int pcmk_controld_api_shutdown(pcmk_ipc_api_t *api, const char *node_name)
Definition: ipc_controld.c:447
int pcmk_controld_api_node_info(pcmk_ipc_api_t *api, uint32_t nodeid)
Send a "node info" controller operation.
Definition: ipc_controld.c:368
enum crm_ais_msg_types type
Definition: internal.h:83
pcmk_controld_api_reply
Possible types of controller replies.
Definition: ipc_controld.h:30