pacemaker
2.1.5-b7adf64e51
Scalable High-Availability cluster resource manager
|
High Level API. More...
#include <glib.h>
#include <libxml/tree.h>
#include <crm/cib/cib_types.h>
#include <crm/pengine/pe_types.h>
#include <crm/stonith-ng.h>
Go to the source code of this file.
Data Structures | |
struct | pcmk_injections_t |
Synthetic cluster events that can be injected into the cluster for running simulations. More... | |
Enumerations | |
enum | pcmk_sim_flags { pcmk_sim_none = 0, pcmk_sim_all_actions = 1 << 0, pcmk_sim_show_pending = 1 << 1, pcmk_sim_process = 1 << 2, pcmk_sim_show_scores = 1 << 3, pcmk_sim_show_utilization = 1 << 4, pcmk_sim_simulate = 1 << 5, pcmk_sim_sanitized = 1 << 6, pcmk_sim_verbose = 1 << 7 } |
Modify operation of running a cluster simulation. More... | |
enum | pcmk_rc_disp_flags { pcmk_rc_disp_none = 0, pcmk_rc_disp_code = (1 << 0), pcmk_rc_disp_name = (1 << 1), pcmk_rc_disp_desc = (1 << 2) } |
Functions | |
int | pcmk_controller_status (xmlNodePtr *xml, char *dest_node, unsigned int message_timeout_ms) |
Get controller status. More... | |
int | pcmk_designated_controller (xmlNodePtr *xml, unsigned int message_timeout_ms) |
Get designated controller. More... | |
void | pcmk_free_injections (pcmk_injections_t *injections) |
Free a :pcmk_injections_t structure. More... | |
int | pcmk_pacemakerd_status (xmlNodePtr *xml, const char *ipc_name, unsigned int message_timeout_ms) |
Get and output pacemakerd status. More... | |
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. More... | |
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's response to events. More... | |
int | pcmk_list_nodes (xmlNodePtr *xml, char *node_types) |
Get nodes list. More... | |
int | pcmk_status (xmlNodePtr *xml) |
Output the current status of the cluster, formatted in the same way that crm_mon --output-as=xml would. More... | |
int | pcmk_check_rules (xmlNodePtr *xml, xmlNodePtr input, const crm_time_t *date, const char **rule_ids) |
Check whether each rule in a list is in effect. More... | |
int | pcmk_show_result_code (xmlNodePtr *xml, int code, enum pcmk_result_type type, uint32_t flags) |
int | pcmk_list_result_codes (xmlNodePtr *xml, enum pcmk_result_type type, uint32_t flags) |
List all valid result codes in a particular family. More... | |
High Level API.
Definition in file pacemaker.h.
enum pcmk_rc_disp_flags |
Enumerator | |
---|---|
pcmk_rc_disp_none | (Does nothing) |
pcmk_rc_disp_code | Display result code number. |
pcmk_rc_disp_name | Display result code name. |
pcmk_rc_disp_desc | Display result code description. |
Definition at line 234 of file pacemaker.h.
enum pcmk_sim_flags |
Modify operation of running a cluster simulation.
Enumerator | |
---|---|
pcmk_sim_none | |
pcmk_sim_all_actions | |
pcmk_sim_show_pending | |
pcmk_sim_process | |
pcmk_sim_show_scores | |
pcmk_sim_show_utilization | |
pcmk_sim_simulate | |
pcmk_sim_sanitized | |
pcmk_sim_verbose |
Definition at line 34 of file pacemaker.h.
int pcmk_check_rules | ( | xmlNodePtr * | xml, |
xmlNodePtr | input, | ||
const crm_time_t * | date, | ||
const char ** | rule_ids | ||
) |
Check whether each rule in a list is in effect.
[in,out] | xml | The destination for the result, as an XML tree |
[in] | input | The CIB XML to check (if NULL , use current CIB) |
[in] | date | Check whether the rule is in effect at this date and time (if NULL , use current date and time) |
[in] | rule_ids | The IDs of the rules to check, as a NULL - terminated list. |
Definition at line 280 of file pcmk_rule.c.
int pcmk_controller_status | ( | xmlNodePtr * | xml, |
char * | dest_node, | ||
unsigned int | message_timeout_ms | ||
) |
Get controller status.
[in,out] | xml | The destination for the result, as an XML tree. |
[in] | dest_node | Destination node for request |
[in] | message_timeout_ms | Message timeout |
Definition at line 327 of file pcmk_cluster_queries.c.
int pcmk_designated_controller | ( | xmlNodePtr * | xml, |
unsigned int | message_timeout_ms | ||
) |
Get designated controller.
[in,out] | xml | The destination for the result, as an XML tree. |
[in] | message_timeout_ms | Message timeout |
Definition at line 384 of file pcmk_cluster_queries.c.
void pcmk_free_injections | ( | pcmk_injections_t * | injections | ) |
Free a :pcmk_injections_t structure.
[in,out] | injections | The structure to be freed |
Definition at line 732 of file pcmk_injections.c.
int pcmk_list_nodes | ( | xmlNodePtr * | xml, |
char * | node_types | ||
) |
Get nodes list.
[in,out] | xml | The destination for the result, as an XML tree. |
[in] | node_types | Node type(s) to return (default: all) |
Definition at line 568 of file pcmk_cluster_queries.c.
int pcmk_list_result_codes | ( | xmlNodePtr * | xml, |
enum pcmk_result_type | type, | ||
uint32_t | flags | ||
) |
List all valid result codes in a particular family.
[in,out] | xml | The destination for the result, as an XML tree |
[in] | type | The family of result codes to list. Supported values: pcmk_result_legacy , pcmk_result_rc , pcmk_result_exitcode . |
[in] | flags | Group of pcmk_rc_disp_flags |
Definition at line 151 of file pcmk_result_code.c.
int pcmk_pacemakerd_status | ( | xmlNodePtr * | xml, |
const char * | ipc_name, | ||
unsigned int | message_timeout_ms | ||
) |
Get and output pacemakerd
status.
[in,out] | xml | Destination for the result, as an XML tree |
[in] | ipc_name | IPC name for request |
[in] | message_timeout_ms | How long to wait for a reply from the pacemakerd API. If 0, pcmk_ipc_dispatch_sync will be used. If positive, pcmk_ipc_dispatch_main will be used, and a new mainloop will be created for this purpose (freed before return). |
Definition at line 468 of file pcmk_cluster_queries.c.
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.
[out] | xml | Where to store XML with result |
[in] | rsc | Resource to calculate digests for |
[in] | node | Node whose operation history should be used |
[in] | overrides | Hash table of configuration parameters to override |
[in] | data_set | Cluster working set (with status) |
Definition at line 157 of file pcmk_resource.c.
int pcmk_show_result_code | ( | xmlNodePtr * | xml, |
int | code, | ||
enum pcmk_result_type | type, | ||
uint32_t | flags | ||
) |
Definition at line 62 of file pcmk_result_code.c.
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's response to events.
This high-level function essentially implements crm_simulate(8). It operates on an input CIB file and various lists of events that can be simulated. It optionally writes out a variety of artifacts to show the results of the simulation. Output can be modified with various flags.
[in,out] | xml | The destination for the result, as an XML tree. |
[in,out] | data_set | Working set for the cluster. |
[in] | events | A structure containing cluster events (node up/down, tickets, injected operations) |
[in] | flags | A bitfield of :pcmk_sim_flags to modify operation of the simulation. |
[in] | section_opts | Which portions of the cluster status output should be displayed? |
[in] | use_date | The date to set the cluster's time to (may be NULL). |
[in] | input_file | The source CIB file, which may be overwritten by this function (may be NULL). |
[in] | graph_file | Where to write the XML-formatted transition graph (may be NULL, in which case no file will be written). |
[in] | dot_file | Where to write the dot(1) formatted transition graph (may be NULL, in which case no file will be written). See pcmk__write_sim_dotfile() . |
Definition at line 966 of file pcmk_simulate.c.
int pcmk_status | ( | xmlNodePtr * | xml | ) |
Output the current status of the cluster, formatted in the same way that crm_mon --output-as=xml
would.
[in,out] | xml | The destination for the result, as an XML tree. |
Definition at line 170 of file pcmk_status.c.