pacemaker  2.1.7-0f7f88312f
Scalable High-Availability cluster resource manager
Functions
pcmk_cluster_queries.c File Reference
#include <crm_internal.h>
#include <libxml/tree.h>
#include <pacemaker.h>
#include <pacemaker-internal.h>
#include <crm/crm.h>
#include <crm/cib.h>
#include <crm/cib/internal.h>
#include <crm/msg_xml.h>
#include <crm/common/output_internal.h>
#include <crm/common/xml.h>
#include <crm/common/xml_internal.h>
#include <crm/common/iso8601.h>
#include <crm/common/ipc_controld.h>
#include <crm/common/ipc_pacemakerd.h>
Include dependency graph for pcmk_cluster_queries.c:

Go to the source code of this file.

Functions

int pcmk__controller_status (pcmk__output_t *out, const char *node_name, unsigned int message_timeout_ms)
 
int pcmk_controller_status (xmlNodePtr *xml, const char *node_name, unsigned int message_timeout_ms)
 Get and output controller status. More...
 
int pcmk__designated_controller (pcmk__output_t *out, unsigned int message_timeout_ms)
 
int pcmk_designated_controller (xmlNodePtr *xml, unsigned int message_timeout_ms)
 Get and output designated controller node name. More...
 
int pcmk__query_node_info (pcmk__output_t *out, uint32_t *node_id, char **node_name, char **uuid, char **state, bool *have_quorum, bool *is_remote, bool show_output, unsigned int message_timeout_ms)
 
int pcmk_query_node_info (xmlNodePtr *xml, uint32_t *node_id, char **node_name, char **uuid, char **state, bool *have_quorum, bool *is_remote, bool show_output, unsigned int message_timeout_ms)
 Get and optionally output node info corresponding to a node ID from the controller. More...
 
int pcmk__pacemakerd_status (pcmk__output_t *out, const char *ipc_name, unsigned int message_timeout_ms, bool show_output, enum pcmk_pacemakerd_state *state)
 
int pcmk_pacemakerd_status (xmlNodePtr *xml, const char *ipc_name, unsigned int message_timeout_ms)
 Get and output pacemakerd status. More...
 
int pcmk__list_nodes (pcmk__output_t *out, const char *node_types, bool bash_export)
 
int pcmk_list_nodes (xmlNodePtr *xml, const char *node_types)
 Get nodes list. More...
 

Function Documentation

◆ pcmk__controller_status()

int pcmk__controller_status ( pcmk__output_t out,
const char *  node_name,
unsigned int  message_timeout_ms 
)

Definition at line 460 of file pcmk_cluster_queries.c.

◆ pcmk__designated_controller()

int pcmk__designated_controller ( pcmk__output_t out,
unsigned int  message_timeout_ms 
)

Definition at line 530 of file pcmk_cluster_queries.c.

◆ pcmk__list_nodes()

int pcmk__list_nodes ( pcmk__output_t out,
const char *  node_types,
bool  bash_export 
)

Definition at line 829 of file pcmk_cluster_queries.c.

◆ pcmk__pacemakerd_status()

int pcmk__pacemakerd_status ( pcmk__output_t out,
const char *  ipc_name,
unsigned int  message_timeout_ms,
bool  show_output,
enum pcmk_pacemakerd_state state 
)

Definition at line 738 of file pcmk_cluster_queries.c.

◆ pcmk__query_node_info()

int pcmk__query_node_info ( pcmk__output_t out,
uint32_t *  node_id,
char **  node_name,
char **  uuid,
char **  state,
bool *  have_quorum,
bool *  is_remote,
bool  show_output,
unsigned int  message_timeout_ms 
)

Definition at line 617 of file pcmk_cluster_queries.c.

◆ pcmk_controller_status()

int pcmk_controller_status ( xmlNodePtr *  xml,
const char *  node_name,
unsigned int  message_timeout_ms 
)

Get and output controller status.

Parameters
[in,out]xmlDestination for the result, as an XML tree
[in]node_nameName of node whose status is desired (NULL for DC)
[in]message_timeout_msHow long to wait for a reply from the pacemaker-controld API. If 0, pcmk_ipc_dispatch_sync will be used. Otherwise, pcmk_ipc_dispatch_poll will be used.
Returns
Standard Pacemaker return code

Definition at line 498 of file pcmk_cluster_queries.c.

◆ pcmk_designated_controller()

int pcmk_designated_controller ( xmlNodePtr *  xml,
unsigned int  message_timeout_ms 
)

Get and output designated controller node name.

Parameters
[in,out]xmlDestination for the result, as an XML tree
[in]message_timeout_msHow long to wait for a reply from the pacemaker-controld API. If 0, pcmk_ipc_dispatch_sync will be used. Otherwise, pcmk_ipc_dispatch_poll will be used.
Returns
Standard Pacemaker return code

Definition at line 567 of file pcmk_cluster_queries.c.

◆ pcmk_list_nodes()

int pcmk_list_nodes ( xmlNodePtr *  xml,
const char *  node_types 
)

Get nodes list.

Parameters
[in,out]xmlThe destination for the result, as an XML tree
[in]node_typesNode type(s) to return (default: all)
Returns
Standard Pacemaker return code

Definition at line 884 of file pcmk_cluster_queries.c.

◆ pcmk_pacemakerd_status()

int pcmk_pacemakerd_status ( xmlNodePtr *  xml,
const char *  ipc_name,
unsigned int  message_timeout_ms 
)

Get and output pacemakerd status.

Parameters
[in,out]xmlDestination for the result, as an XML tree
[in]ipc_nameIPC name for request
[in]message_timeout_msHow long to wait for a reply from the pacemakerd API. If 0, pcmk_ipc_dispatch_sync will be used. Otherwise, pcmk_ipc_dispatch_poll will be used.
Returns
Standard Pacemaker return code

Definition at line 786 of file pcmk_cluster_queries.c.

◆ pcmk_query_node_info()

int pcmk_query_node_info ( xmlNodePtr *  xml,
uint32_t *  node_id,
char **  node_name,
char **  uuid,
char **  state,
bool *  have_quorum,
bool *  is_remote,
bool  show_output,
unsigned int  message_timeout_ms 
)

Get and optionally output node info corresponding to a node ID from the controller.

Parameters
[in,out]xmlDestination for the result, as an XML tree
[in,out]node_idID of node whose name to get. If NULL or 0, get the local node name. If not NULL, store the true node ID here on success.
[out]node_nameIf not NULL, where to store the node name
[out]uuidIf not NULL, where to store the node UUID
[out]stateIf not NULL, where to store the membership state
[out]is_remoteIf not NULL, where to store whether the node is a Pacemaker Remote node
[out]have_quorumIf not NULL, where to store whether the node has quorum
[in]show_outputWhether to output the node info
[in]message_timeout_msHow long to wait for a reply from the pacemaker-controld API. If 0, pcmk_ipc_dispatch_sync will be used. Otherwise, pcmk_ipc_dispatch_poll will be used.
Returns
Standard Pacemaker return code
Note
The caller is responsible for freeing *node_name, *uuid, and *state using free().

Definition at line 690 of file pcmk_cluster_queries.c.