pacemaker  2.1.3-ea053b43a
Scalable High-Availability cluster resource manager
ipc_controld.h
Go to the documentation of this file.
1 /*
2  * Copyright 2020-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 PCMK__CRM_COMMON_IPC_CONTROLD__H
11 # define PCMK__CRM_COMMON_IPC_CONTROLD__H
12 
13 
14 #include <stdbool.h> // bool
15 #include <glib.h> // GList
16 #include <libxml/tree.h> // xmlNode
17 #include <crm/common/ipc.h> // pcmk_ipc_api_t
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
38 };
39 
40 // Node information passed with pcmk_controld_reply_nodes
41 typedef struct {
42  uint32_t id;
43  const char *uname;
44  const char *state;
46 
58 typedef struct {
59  enum pcmk_controld_api_reply reply_type;
60  const char *feature_set;
61  const char *host_from;
62 
63  union {
64  // pcmk_controld_reply_info
65  struct {
67  bool is_remote;
68  int id;
69  const char *uuid;
70  const char *uname;
71  const char *state;
72  } node_info;
73 
74  // pcmk_controld_reply_resource
75  struct {
76  xmlNode *node_state; //<! Resource operation history XML
77  } resource;
78 
79  // pcmk_controld_reply_ping
80  struct {
81  const char *sys_from;
82  const char *fsa_state;
83  const char *result;
84  } ping;
85 
86  // pcmk_controld_reply_nodes
87  GList *nodes; // list of pcmk_controld_api_node_t *
88  } data;
90 
91 int pcmk_controld_api_reprobe(pcmk_ipc_api_t *api, const char *target_node,
92  const char *router_node);
93 int pcmk_controld_api_node_info(pcmk_ipc_api_t *api, uint32_t nodeid);
94 int pcmk_controld_api_fail(pcmk_ipc_api_t *api, const char *target_node,
95  const char *router_node, const char *rsc_id,
96  const char *rsc_long_id, const char *standard,
97  const char *provider, const char *type);
98 int pcmk_controld_api_refresh(pcmk_ipc_api_t *api, const char *target_node,
99  const char *router_node, const char *rsc_id,
100  const char *rsc_long_id, const char *standard,
101  const char *provider, const char *type,
102  bool cib_only);
103 int pcmk_controld_api_ping(pcmk_ipc_api_t *api, const char *node_name);
106 
107 #ifdef __cplusplus
108 }
109 #endif
110 
111 #endif // PCMK__CRM_COMMON_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:582
char data[0]
Definition: cpg.c:55
const char * host_from
Name of node that sent reply.
Definition: ipc_controld.h:61
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:560
int pcmk_controld_api_ping(pcmk_ipc_api_t *api, const char *node_name)
Ask the controller for status.
Definition: ipc_controld.c:414
enum crm_ais_msg_types type
Definition: cpg.c:48
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:529
const char * feature_set
CRM feature set advertised by controller.
Definition: ipc_controld.h:60
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:351
int pcmk_controld_api_list_nodes(pcmk_ipc_api_t *api)
Ask the controller for cluster information.
Definition: ipc_controld.c:437
int pcmk_controld_api_node_info(pcmk_ipc_api_t *api, uint32_t nodeid)
Send a "node info" controller operation.
Definition: ipc_controld.c:386
pcmk_controld_api_reply
Possible types of controller replies.
Definition: ipc_controld.h:31